ffsim.MolecularHamiltonianSpinless¶
- class ffsim.MolecularHamiltonianSpinless(one_body_tensor, two_body_tensor, constant=0.0)[source]¶
Bases:
SupportsApproximateEquality,SupportsDiagonal,SupportsFermionOperator,SupportsLinearOperatorA spinless molecular Hamiltonian.
A Hamiltonian of the form
\[H = \sum_{pq} h_{pq} a^\dagger_{p} a_{q} + \frac12 \sum_{pqrs} h_{pqrs} a^\dagger_{p} a^\dagger_{r} a_{s} a_{q} + \text{constant}.\]Here \(h_{pq}\) is called the one-body tensor and \(h_{pqrs}\) is called the two-body tensor.
Attributes
The constant.
The number of orbitals.
The one-body tensor.
The two-body tensor.
- norb¶
The number of orbitals.
Methods
Initialize a MolecularHamiltonianSpinless from a FermionOperator.
rotated(orbital_rotation)Return the Hamiltonian in a rotated orbital basis.
- static from_fermion_operator(op)[source]¶
Initialize a MolecularHamiltonianSpinless from a FermionOperator.
The input operator must contain only terms of the following form:
A real-valued constant
\(a^\dagger_p a_q\)
\(a^\dagger_p a^\dagger_r a_s a_q\)
Any other terms will cause an error to be raised. No attempt will be made to normal-order terms.
Since the Hamiltonian is spinless, the fermionic actions in the input operator must all carry the spin alpha label (see
cre_a()anddes_a()).- Parameters:
op (
FermionOperator) – The FermionOperator from which to initialize the Hamiltonian.- Return type:
- Returns:
The MolecularHamiltonianSpinless represented by the input FermionOperator.
- rotated(orbital_rotation)[source]¶
Return the Hamiltonian in a rotated orbital basis.
Given an orbital rotation \(\mathcal{U}\), returns the operator
\[\mathcal{U} H \mathcal{U}^\dagger\]where \(H\) is the original Hamiltonian.
- Parameters:
orbital_rotation (
ndarray) – The orbital rotation.- Return type:
- Returns:
The rotated Hamiltonian.