pmm_tools.utils
Functions
| Name | Description |
|---|---|
evaluate_hamiltonian | Compute the Hamiltonian from terms for a set of parameters |
fermionic_eigsh | Diagonalize a Hamiltonian using fermionic superselection rules. |
evaluate_hamiltonianfunction#
def evaluate_hamiltonian(params, terms, sparse)Compute the Hamiltonian from terms for a set of parameters
fermionic_eigshfunction#
def fermionic_eigsh(hamiltonian, parity, k=6)Diagonalize a Hamiltonian using fermionic superselection rules. The Hamiltonian is assumed to be block-diagonal in the parity subspaces. The function returns the eigenvalues and eigenvectors of the Hamiltonian, sorted by increasing energy.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
hamiltonian | scipy.sparse.csr_matrix | required | The Hamiltonian matrix to be diagonalized. |
parity | scipy.sparse.csr_matrix | required | The parity operator matrix, which is assumed to be diagonal in the same basis as the Hamiltonian. |
k | int | 6 | The number of eigenvalues and eigenvectors to compute. Default is 6. |
Returns
evalslist of numpy.ndarrayThe eigenvalues of the Hamiltonian separated in parity subspaces.
evecslist of numpy.ndarrayThe eigenvectors of the Hamiltonian separated in parity subspaces.