@np.deprecate(new_name="<STR_LIT>")<EOL>def expm3(A, q=<NUM_LIT:20>):
A = _asarray_square(A)<EOL>n = A.shape[<NUM_LIT:0>]<EOL>t = A.dtype.char<EOL>if t not in ['<STR_LIT:f>','<STR_LIT:F>','<STR_LIT:d>','<STR_LIT:D>']:<EOL><INDENT>A = A.astype('<STR_LIT:d>')<EOL>t = '<STR_LIT:d>'<EOL><DEDENT>eA = np.identity(n, dtype=t)<EOL>trm = np.identity(n, dtype=t)<EOL>castfunc = cast[t]<EOL>for k in range(<NUM_LIT:1>, q):<EOL><INDENT>trm[:] = trm.dot(A) / castfunc(k)<EOL>eA += trm<EOL><DEDENT>return eA<EOL>
Compute the matrix exponential using Taylor series.

Parameters
----------
A : (N, N) array_like
    Matrix to be exponentiated
q : int
    Order of the Taylor series used is `q-1`

Returns
-------
expm3 : (N, N) ndarray
    Matrix exponential of `A`