quimb.linalg.numpy_linalg ========================= .. py:module:: quimb.linalg.numpy_linalg .. autoapi-nested-parse:: Numpy base linear algebra. Attributes ---------- .. autoapisummary:: quimb.linalg.numpy_linalg._NUMPY_EIG_FUNCS quimb.linalg.numpy_linalg._DENSE_EIG_METHODS Functions --------- .. autoapisummary:: quimb.linalg.numpy_linalg.eigensystem_autoblocked quimb.linalg.numpy_linalg.eig_numpy quimb.linalg.numpy_linalg.sort_inds quimb.linalg.numpy_linalg.eigs_numpy quimb.linalg.numpy_linalg.svds_numpy Module Contents --------------- .. py:function:: eigensystem_autoblocked(A, sort=True, return_vecs=True, isherm=True) Perform Hermitian eigen-decomposition, automatically identifying and exploiting symmetries appearing in the current basis as block diagonals formed via permutation of rows and columns. The whole process is accelerated using ``numba``. :param A: The operator to eigen-decompose. :type A: array_like :param sort: Whether to sort into ascending order, default True. :type sort: bool, optional :param isherm: Whether ``A`` is hermitian, default True. :type isherm: bool, optional :param return_vecs: Whether to return the eigenvectors, default True. :type return_vecs: bool, optional :returns: * **evals** (*1D-array*) -- The eigenvalues. * **evecs** (*qarray*) -- If ``return_vecs=True``, the eigenvectors. .. py:data:: _NUMPY_EIG_FUNCS .. py:function:: eig_numpy(A, sort=True, isherm=True, return_vecs=True, autoblock=False) Numpy based dense eigensolve. :param A: The operator to decompose. :type A: array_like :param sort: Whether to sort into ascending order. :type sort: bool, optional :param isherm: Whether ``A`` is hermitian. :type isherm: bool, optional :param return_vecs: Whether to return the eigenvectors. :type return_vecs: bool, optional :param autoblock: If true, automatically identify and exploit symmetries appearing in the current basis as block diagonals formed via permutation of rows and columns. :type autoblock: bool, optional :returns: * **evals** (*1D-array*) -- The eigenvalues. * **evecs** (*qarray*) -- If ``return_vecs=True``, the eigenvectors. .. py:function:: sort_inds(a, method, sigma=None) Return the sorting inds of a list :param a: List to base sort on. :type a: array_like :param method: Method of sorting list, one of * "LM" - Largest magnitude first * "SM" - Smallest magnitude first * "SA" - Smallest algebraic first * "SR" - Smallest real part first * "SI" - Smallest imaginary part first * "LA" - Largest algebraic first * "LR" - Largest real part first * "LI" - Largest imaginary part first * "TM" - Magnitude closest to target sigma first * "TR" - Real part closest to target sigma first * "TI" - Imaginary part closest to target sigma first :type method: str :param sigma: The target if method={"TM", "TR", or "TI"}. :type sigma: float, optional :returns: **inds** -- Indices that would sort `a` based on `method` :rtype: array of int .. py:data:: _DENSE_EIG_METHODS .. py:function:: eigs_numpy(A, k, B=None, which=None, return_vecs=True, sigma=None, isherm=True, P=None, sort=True, **eig_opts) Partial eigen-decomposition using numpy's dense linear algebra. :param A: Operator to partially eigen-decompose. :type A: array_like or quimb.Lazy :param k: Number of eigenpairs to return. :type k: int :param B: If given, the RHS operator defining a generalized eigen problem. :type B: array_like or quimb.Lazy :param which: Which part of the spectrum to target. :type which: str, optional :param return_vecs: Whether to return eigenvectors. :type return_vecs: bool, optional :param sigma: Target eigenvalue. :type sigma: None or float, optional :param isherm: Whether `a` is hermitian. :type isherm: bool, optional :param P: Perform the eigensolve in the subspace defined by this projector. :type P: array_like or quimb.Lazy :param sort: Whether to sort reduced list of eigenpairs into ascending order. :type sort: bool, optional :param eig_opts: Settings to pass to numpy.eig... functions. :returns: **lk, (vk)** :rtype: k eigenvalues (and eigenvectors) sorted according to which .. py:function:: svds_numpy(a, k, return_vecs=True, **_) Partial singular value decomposition using numpys (full) singular value decomposition. :param a: Operator to decompose. :type a: array_like :param k: Number of singular value triplets to retrieve. :type k: int, optional :param return_vecs: whether to return the computed vecs or values only :type return_vecs: bool, optional :returns: Singlar value triplets. :rtype: (uk,) sk (, vkt)