View source on GitHub |
Richardson Gaudin model.
Inherits From: DOCIHamiltonian
, PolynomialTensor
openfermion.hamiltonians.RichardsonGaudin(
g, n_qubits
)
Class for storing and constructing Richardson Gaudin hamiltonians combining an equi-distant potential ladder like potential per qubit with a uniform coupling between any pair of qubits with coupling strength g, which can be either attractive (g<0) or repulsive (g>0).
The operators represented by this class has the form:
.. math::
H = \sum_{p=0} (p + 1) N_p + g/2 \sum_{p < q} P_p^\dagger P_q,
where
.. math::
\begin{align}
N_p &= (1 - \sigma^Z_p)/2, \\
P_p &= a_{p,\beta} a_{p,\alpha} = S^{-} = \sigma^X + i \sigma^Y, \\
g &= constant coupling term
\end{align}
Note; The diagonal of the Hamiltonian is composed of the values in range((n_qubits+1)*n_qubits//2+1).
Args | |
---|---|
g
|
float
Coupling strength |
n_qubits
|
int
Number of qubits |
Methods
from_integrals
@classmethod
from_integrals( constant, one_body_integrals, two_body_integrals )
get_antisymmetrized_tensors
get_antisymmetrized_tensors()
Antisymmetrized Tensors Directly returns antisymmetrized tensors, which, when used to construct an FermionOperator via an InteractionOperator produce a FermionOperator that acts like this RichardsonGaudin Hamiltonian on the paired (seniority zero) subspace. Compared to the FermionOperator that can be obtained via the n_body_tensors property from the DOCIHamiltonian class the FermionOperator from the tensors returned by this function do not contain same spin coupling terms. These terms act trivially on the paired subspace and this the two Hamiltonian agree on any senioirty zero state. Returns: tuple: Tuple of one and two body tensors.
get_projected_integrals
get_projected_integrals()
Creates the one and two body integrals that would correspond to a hypothetic electronic structure Hamiltonian, which would satisfy the given set of hc, hr1 and hr2.
This is technically not well-defined, as hr2 is not generated in a one-to-one fashion. This implies that calling
get_doci_from_integrals( *get_projected_integrals_from_doci( hc, hr1, hr2 ) )
should return the same hc, hr1, and hr2, but there is no such guarantee for
get_projected_integrals_from_doci( *get_doci_from_integrals( one_body_integrals, two_body_integrals ) )
but this method attempts to create integrals that conform to the same symmetries as a physical electronic structure Hamiltonian would, with inevitable loss of information due to the ambiguity above.
Args | |
---|---|
hc [numpy array]: The single-particle DOCI terms in matrix form hr1 [numpy array]: The off-diagonal DOCI Hamiltonian terms in matrix form hr2 [numpy array]: The diagonal DOCI Hamiltonian terms in matrix form |
Returns | |
---|---|
projected_onebody_integrals [numpy array]: The corresponding one-body integrals for the electronic structure Hamiltonian projected_twobody_integrals [numpy array]: The corresponding two body integrals for the electronic structure Hamiltonian |
projected_n_body_tensors
projected_n_body_tensors(
selection, exact=False
)
Keep only selected elements.
Args | |
---|---|
selection
|
Union[int, Iterable[int]
If int, keeps terms with at most (exactly, if exact is True) that many unique indices. If iterable, keeps only terms containing (all of, if exact is True) the specified indices. |
exact
|
bool
Whether or not the selection is strict. |
rotate_basis
rotate_basis(
rotation_matrix
)
Rotate the orbital basis of the PolynomialTensor.
Args | |
---|---|
rotation_matrix
|
A square numpy array or matrix having dimensions of n_qubits by n_qubits. Assumed to be real and invertible. |
with_function_applied_elementwise
with_function_applied_elementwise(
func
)
xx_term
xx_term(
p, q
)
Returns the XX term on a single pair of qubits as a QubitOperator Arguments: p, q [int] -- qubit indices Returns: [QubitOperator] -- XX term on the chosen qubits.
yy_term
yy_term(
p, q
)
Returns the YY term on a single pair of qubits as a QubitOperator Arguments: p, q [int] -- qubit indices Returns: [QubitOperator] -- YY term on the chosen qubits.
z_term
z_term(
p
)
Returns the Z term on a single qubit as a QubitOperator Arguments: p [int] -- qubit index Returns: [QubitOperator] -- Z term on the chosen qubit.
zero
@classmethod
zero( n_qubits )
zz_term
zz_term(
p, q
)
Returns the ZZ term on a single pair of qubits as a QubitOperator Arguments: p, q [int] -- qubit indices Returns: [QubitOperator] -- ZZ term on the chosen qubits.
__add__
__add__(
addend
)
__eq__
__eq__(
other
)
Return self==value.
__getitem__
__getitem__(
args
)
Look up matrix element.
Args | |
---|---|
args
|
Tuples indicating which coefficient to get. For instance,
my_tensor[(6, 1), (8, 1), (2, 0)]
returns
my_tensor.n_body_tensors[1, 1, 0][6, 8, 2]
|
__iter__
__iter__()
Iterate over non-zero elements of PolynomialTensor.
__mod__
__mod__(
other
)
__mul__
__mul__(
multiplier
)
__ne__
__ne__(
other
)
Return self!=value.
__neg__
__neg__()
__radd__
__radd__(
addend
)
__rmul__
__rmul__(
multiplier
)
__rsub__
__rsub__(
subtrahend
)
__sub__
__sub__(
subtrahend
)
__truediv__
__truediv__(
dividend
)