View source on GitHub |
The Sparse Hamiltonian is characterized by having only one or a few
Inherits From: Hamiltonian
fqe.sparse_hamiltonian.SparseHamiltonian(
operators: Union[FermionOperator, str],
conserve_spin: bool = True,
e_0: complex = (0.0 + 0.0j)
) -> None
elements which are non-zero. This can provide advantages for certain operations where single element access is preferred.
Args | |
---|---|
operators
|
Operator with a coefficient in the FermionOperator format. |
conserve_spin
|
Whether or not to conserve the Sz symmetry. |
e_0
|
Scalar part of the Hamiltonian. |
Methods
calc_diag_transform
calc_diag_transform() -> np.ndarray
Performs a unitary digaonlizing transformation of the one-body term and returns that transformation.
conserve_number
conserve_number() -> bool
Returns True if the Hamiltonian is number conserving, else False.
diag_values
diag_values() -> np.ndarray
Returns the diagonal values packed into a single dimension.
diagonal
diagonal() -> bool
Returns True if the Hamiltonian is diagonal, else False.
diagonal_coulomb
diagonal_coulomb() -> bool
Returns True if the Hamiltonian is diagonal coloumb, else False.
dim
dim()
Dim is the orbital dimension of the Hamiltonian arrays. This function should not be used with SparseHamiltonian
e_0
e_0()
Returns the scalar potential of the Hamiltonian.
iht
iht(
time: float
) -> "SparseHamiltonian"
Return the matrices of the Hamiltonian prepared for time evolution.
Args | |
---|---|
time
|
The time step. |
is_individual
is_individual() -> bool
Returns if this Hamiltonian consists of an individual operator plus its Hermitian conjugate.
nterms
nterms() -> int
Returns the number of non-zero elements in the Hamiltonian.
quadratic
quadratic() -> bool
Returns True if the Hamiltonian is quadratic, else False.
rank
rank() -> int
Returns the rank of the largest tensor.
tensors
tensors() -> Tuple[np.ndarray, ...]
Returns all tensors in order of their rank.
terms
terms()
Returns the operators that comprise the SparseHamiltonian.
terms_hamiltonian
terms_hamiltonian() -> List['SparseHamiltonian']
Returns a list of all SparseHamiltonian operator terms.
transform
transform(
trans: np.ndarray
) -> np.ndarray
Tranform the one body term using the provided matrix.
Args | |
---|---|
trans
|
Unitary transformation. |
Returns | |
---|---|
Transformed one-body Hamiltonian as a numpy.ndarray. |