Quanlse/Utils/Functions.py
def eigenSystem(matrix: ndarray):
    """
    compute the eigenvalues and the corresponding eigenvectors for the given matrix.
    (sorted by eigenvalues: Ascending order)

    :param matrix: base matrix of the eigen system

    :return: sorted eigenvalues (eigenenergies) and corresponding eigenvectors (eigenstates) (ordered by column)
    """
    # Solve eigenvalues problem
    eigenVals, eigenVecs = linalg.eig(matrix)

    # Rearrange eigenvalues and eigenvectors in the ascending order
    sortedIndex = eigenVals.argsort()
    eigenVecs = eigenVecs[:, sortedIndex]
    eigenVals = eigenVals[sortedIndex]
    eigenVecs = eigenVecs

    return eigenVals.real, eigenVecs

    compute the eigenvalues and the corresponding eigenvectors for the given matrix.
    (sorted by eigenvalues: Ascending order)

    :param matrix: base matrix of the eigen system

    :return: sorted eigenvalues (eigenenergies) and corresponding eigenvectors (eigenstates) (ordered by column)
    
compute the eigenvalues and the corresponding eigenvectors for the given matrix.
(sorted by eigenvalues: Ascending order)
compute the eigenvalues and the corresponding eigenvectors for the given matrix . ( sorted by eigenvalues : Ascending order )
def eigenSystem(matrix: ndarray):
    eigenVals, eigenVecs = linalg.eig(matrix)
    sortedIndex = eigenVals.argsort()
    eigenVecs = eigenVecs[:, sortedIndex]
    eigenVals = eigenVals[sortedIndex]
    eigenVecs = eigenVecs
    return eigenVals.real, eigenVecs
def eigenSystem ( matrix : ndarray ) : eigenVals , eigenVecs = linalg . eig ( matrix ) sortedIndex = eigenVals . argsort ( ) eigenVecs = eigenVecs [ : , sortedIndex ] eigenVals = eigenVals [ sortedIndex ] eigenVecs = eigenVecs return eigenVals . real , eigenVecs
compute the eigenvalues and the corresponding eigenvectors for the given matrix.
compute the eigenvalues and the corresponding eigenvectors for the given matrix .
"""
    compute the eigenvalues and the corresponding eigenvectors for the given matrix.
    (sorted by eigenvalues: Ascending order)

    :param matrix: base matrix of the eigen system

    :return: sorted eigenvalues (eigenenergies) and corresponding eigenvectors (eigenstates) (ordered by column)
    """ # Solve eigenvalues problem # Rearrange eigenvalues and eigenvectors in the ascending order
sorted eigenvalues (eigenenergies) and corresponding eigenvectors (eigenstates) (ordered by column)
sorted eigenvalues ( eigenenergies ) and corresponding eigenvectors ( eigenstates ) ( ordered by column )
matrix
ndarray
base matrix of the eigen system
base matrix of the eigen system