FermionOperator
Base class: Operator
Base class for all fermionic quantum operators.
Factories
PairingSum(const Operator operator) -> FermionOperator
The PairingSum operator is parametrized by a sparse matrix of size . Each entry for corresponds to the operator , whilst each entry for corresponds to the operator . The PairingSum operator represents the sum
Parameters
- operator: A sum of fermionic operators corresponding to pairing terms.
PairingSum(const RealMatrix matrix) -> FermionOperator
The PairingSum operator is parametrized by a sparse matrix of size . Each entry for corresponds to the operator , whilst each entry for corresponds to the operator . The PairingSum operator represents the sum
Parameters
- matrix: The B matrix of the corresponding Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.
PairingSum(const ComplexSparseMatrix matrix) -> FermionOperator
The PairingSum operator is parametrized by a sparse matrix of size . Each entry for corresponds to the operator , whilst each entry for corresponds to the operator . The PairingSum operator represents the sum
Parameters
- matrix: The B matrix of the corresponding Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.
PairingSum(const ComplexMatrix matrix) -> FermionOperator
The PairingSum operator is parametrized by a sparse matrix of size . Each entry for corresponds to the operator , whilst each entry for corresponds to the operator . The PairingSum operator represents the sum
Parameters
- matrix: The B matrix of the corresponding Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.
PairingSum(const RealSparseMatrix matrix) -> FermionOperator
The PairingSum operator is parametrized by a sparse matrix of size . Each entry for corresponds to the operator , whilst each entry for corresponds to the operator . The PairingSum operator represents the sum
Parameters
- matrix: The B matrix of the corresponding Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.
PairingSum(const Operator operator, as_real options) -> FermionOperator
The PairingSum operator is parametrized by a sparse matrix of size . Each entry for corresponds to the operator , whilst each entry for corresponds to the operator . The PairingSum operator represents the sum
Parameters
- operator: A sum of fermionic operators corresponding to pairing terms.
- options: Options used to specify the type of the stored coefficients. Options currently include as_real and as_complex
PairingSum(const Operator operator, as_complex options) -> FermionOperator
The PairingSum operator is parametrized by a sparse matrix of size . Each entry for corresponds to the operator , whilst each entry for corresponds to the operator . The PairingSum operator represents the sum
Parameters
- operator: A sum of fermionic operators corresponding to pairing terms.
- options: Options used to specify the type of the stored coefficients. Options currently include as_real and as_complex
QuadraticSum(const ComplexSparseMatrix matrix) -> FermionOperator
The QuadraticSum operator is parametrized by a sparse matrix of size . The operator represents the sum with
Parameters
- matrix: The Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.
QuadraticSum(const ComplexMatrix matrix) -> FermionOperator
The QuadraticSum operator is parametrized by a sparse matrix of size . The operator represents the sum with
Parameters
- matrix: The Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.
QuadraticSum(const RealSparseMatrix matrix) -> FermionOperator
The QuadraticSum operator is parametrized by a sparse matrix of size . The operator represents the sum with
Parameters
- matrix: The Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.
QuadraticSum(const RealMatrix matrix) -> FermionOperator
The QuadraticSum operator is parametrized by a sparse matrix of size . The operator represents the sum with
Parameters
- matrix: The Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.
QuadraticSum(const Operator operator) -> FermionOperator
The QuadraticSum operator is parametrized by a sparse matrix of size . The operator represents the sum with
Parameters
- operator: A sum of fermionic operators corresponding to either pairing or hopping terms.
QuadraticSum(const Operator operator, as_complex options) -> FermionOperator
The QuadraticSum operator is parametrized by a sparse matrix of size . The operator represents the sum with
Parameters
- operator: A sum of fermionic operators corresponding to either pairing or hopping terms.
- options: Options used to specify the type of the stored coefficients. Options currently include as_real and as_complex
QuadraticSum(const Operator operator, as_real options) -> FermionOperator
The QuadraticSum operator is parametrized by a sparse matrix of size . The operator represents the sum with
Parameters
- operator: A sum of fermionic operators corresponding to either pairing or hopping terms.
- options: Options used to specify the type of the stored coefficients. Options currently include as_real and as_complex
Transfer(integer i, integer j) -> FermionOperator
Returns the directed fermionic transfer operator with support on the specified sites.
Parameters
- i: The creation site index.
- j: The annihilation site index.
Example
Transfer(0,3)*Fbit("0011") // Returns (-1 + 0i)|1011>
TransferSum(const RealMatrix matrix) -> FermionOperator
The TransferSum operator is parametrized by a sparse matrix of size . Each entry corresponds to the operator . The TransferSum operator represents the sum .
Parameters
- matrix: The A matrix of the corresponding Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.
TransferSum(const Operator operator) -> FermionOperator
The TransferSum operator is parametrized by a sparse matrix of size . Each entry corresponds to the operator . The TransferSum operator represents the sum .
Parameters
- operator: A sum of fermionic operators corresponding to hopping terms.
TransferSum(const ComplexMatrix matrix) -> FermionOperator
The TransferSum operator is parametrized by a sparse matrix of size . Each entry corresponds to the operator . The TransferSum operator represents the sum .
Parameters
- matrix: The A matrix of the corresponding Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.
TransferSum(const RealSparseMatrix matrix) -> FermionOperator
The TransferSum operator is parametrized by a sparse matrix of size . Each entry corresponds to the operator . The TransferSum operator represents the sum .
Parameters
- matrix: The A matrix of the corresponding Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.
TransferSum(const ComplexSparseMatrix matrix) -> FermionOperator
The TransferSum operator is parametrized by a sparse matrix of size . Each entry corresponds to the operator . The TransferSum operator represents the sum .
Parameters
- matrix: The A matrix of the corresponding Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.
TransferSum(const Operator operator, as_real options) -> FermionOperator
The TransferSum operator is parametrized by a sparse matrix of size . Each entry corresponds to the operator . The TransferSum operator represents the sum .
Parameters
- operator: A sum of fermionic operators corresponding to hopping terms.
- options: Options used to specify the type of the stored coefficients. Options currently include as_real and as_complex
TransferSum(const Operator operator, as_complex options) -> FermionOperator
The TransferSum operator is parametrized by a sparse matrix of size . Each entry corresponds to the operator . The TransferSum operator represents the sum .
Parameters
- operator: A sum of fermionic operators corresponding to hopping terms.
- options: Options used to specify the type of the stored coefficients. Options currently include as_real and as_complex
Operators
CoulombSum(const ComplexTensor tensor) -> FermionOperator
Returns a Coulomb tensor operator sum .
The operator is parametrized by a 4-rank tensor with elements. It acts on a -dimensional Hilbert space assuming interleaved spins, where spatial orbital corresponds to spin-up position and spin-down position .
Note the difference to PairHopSum: CoulombSum assumes implicit physical spin degrees of freedom. Spatial orbital indices up to implicitly expand to cover qubit sites.
Parameters
- tensor: The 4-rank tensor representing the interaction.
CoulombSum(const RealTensor tensor) -> FermionOperator
Returns a Coulomb tensor operator sum .
The operator is parametrized by a 4-rank tensor with elements. It acts on a -dimensional Hilbert space assuming interleaved spins, where spatial orbital corresponds to spin-up position and spin-down position .
Note the difference to PairHopSum: CoulombSum assumes implicit physical spin degrees of freedom. Spatial orbital indices up to implicitly expand to cover qubit sites.
Parameters
- tensor: The 4-rank tensor representing the interaction.
Create(integer i) -> FermionOperator
Returns the fermionic creation operator with support on the specified site.
Parameters
- i: The site index where the operator acts.
Example
Create(3)*Fbit("0010") // Returns (-1 + 0i)|0011>
CreateCreate(integer i, integer j) -> FermionOperator
Returns the pairing term with support on the specified sites.
Parameters
- i: The site index on the left.
- j: The site index on the right.
Example
CreateCreate(0,3)*Fbit("0110") // Returns (1 + 0i)|1111>
Destroy(integer i) -> FermionOperator
Returns the fermionic annihilation operator with support on the specified site.
Parameters
- i: The site index where the operator acts.
Example
Destroy(3)*Fbit("0011") // Returns (-1 + 0i)|0010>
DestroyDestroy(integer i, integer j) -> FermionOperator
Returns the pairing term with support on the specified sites.
Parameters
- i: The first site index on the left.
- j: The second site index on the right.
Example
DestroyDestroy(0,3)*Fbit("1001") // Returns (-1 + 0i)|0000>
DoubleExcitation(integer i, integer j, integer k, integer l) -> FermionOperator
Legacy alias for PairHop. Returns the pair hopping operator with support on the specified sites.
Parameters
- i: The first creation site index.
- j: The second creation site index.
- k: The first annihilation site index.
- l: The second annihilation site index.
Example
DoubleExcitation(0,1,2,3)*Fbit("0110") // Returns (0 + 0i)|0110>
FourBody(integer i, integer j, integer k, integer l) -> FermionOperator
Legacy alias for PairTransfer. Returns the directed pair transfer operator with support on the specified sites.
Parameters
- i: The first creation site index.
- j: The second creation site index.
- k: The first annihilation site index.
- l: The second annihilation site index.
Example
FourBody(0,1,2,3)*Fbit("0110") // Returns (0 + 0i)|0110>
Hop(integer i, integer j) -> FermionOperator
Returns the fermionic hopping operator with support on the specified sites.
Parameters
- i: First site of the hopping operator.
- j: Second site of the hopping operator.
Example
Hop(0,3)*Fbit("0011") // Returns (-1 + 0i)|1010>
HopNumber(integer i, integer j, integer k) -> FermionOperator
Returns the hop-number operator with support on the specified sites.
Parameters
- i: The first hopping site index.
- j: The second hopping site index.
- k: The number operator site index.
Example
HopNumber(0,1,2)*Fbit("0110") // Returns (1 + 0i)|1010>
ModeRotation(real angle, integer i, integer j) -> FermionOperator
Returns the mode rotation operator with support on the specified sites.
Parameters
- angle: The rotation angle in radians.
- i: The first site index.
- j: The second site index.
Example
ModeRotation(pi/2,0,1)*Fbit("1000") // Returns (0 + 1i)|0100>
NearestNumberSum(const List<integer> sites) -> FermionOperator
Returns the sum of nearest-neighbor number interactions with support on the specified sites.
Parameters
- sites: The sites where the operator acts.
Example
NearestNumberSum([0,1,2])*Fbit("0110") // Returns (1 + 0i)|0110>
NextNearestNumberSum(const List<integer> sites) -> FermionOperator
Returns the sum of next-nearest-neighbor number interactions with support on the specified sites.
Parameters
- sites: The sites where the operator acts.
Example
NextNearestNumberSum([0,1,2])*Fbit("0110") // Returns (1 + 0i)|0110>
Number(integer i) -> FermionOperator
Returns the fermionic number operator with support on the specified site.
Parameters
- i: The site index where the operator acts.
Example
Number(3)*Fbit("0010") // Returns (0 + 0i)|0010>
NumberN(const List<integer> sites) -> FermionOperator
Legacy alias for NumberSum. Returns the sum of fermionic number operators with support on the specified sites.
Parameters
- sites: The sites where the operator acts.
Example
NumberN([0,1,2])*Fbit("0110") // Returns (2 + 0i)|0110>
NumberNumber(integer i, integer j) -> FermionOperator
Returns the two-site fermionic number-number interaction operator with support on the specified sites.
Parameters
- i: The first site index.
- j: The second site index.
Example
NumberNumber(1,2)*Fbit("0110") // Returns (1 + 0i)|0110>
NumberNumberNN(const List<integer> sites) -> FermionOperator
Legacy alias for NearestNumberSum. Returns the sum of nearest-neighbor number interactions with support on the specified sites.
Parameters
- sites: The sites where the operator acts.
Example
NumberNumberNN([0,1,2])*Fbit("0110") // Returns (1 + 0i)|0110>
NumberNumberNNN(const List<integer> sites) -> FermionOperator
Legacy alias for NextNearestNumberSum. Returns the sum of next-nearest-neighbor number interactions with support on the specified sites.
Parameters
- sites: The sites where the operator acts.
Example
NumberNumberNNN([0,1,2])*Fbit("0110") // Returns (1 + 0i)|0110>
NumberNumberPhase(real angle, integer i, integer j) -> FermionOperator
Returns the two-site number-number phase operator with support on the specified sites.
Parameters
- angle: The phase angle in radians.
- i: The first site index.
- j: The second site index.
Example
NumberNumberPhase(pi,0,1)*Fbit("1100") // Returns (-1 + 0i)|1100>
NumberPhase(real angle, integer i) -> FermionOperator
Returns the site number phase operator with support on the specified site.
Parameters
- angle: The phase angle in radians.
- i: The site index where the operator acts.
Example
NumberPhase(pi,0)*Fbit("1000") // Returns (-1 + 0i)|1000>
NumberPotential(const List<real> coefficients) -> FermionOperator
Returns an operator representing a weighted sum of number operators , where the site indices are implicitly . If a subset of sites or a different ordering is desired, use the factory overload that accepts an explicit list of site indices.
Parameters
- coefficients: The coefficients .
Example
var coefficients = [1.0,3.0,4.0,0.0]
NumberPotential(coefficients)*Fbit("0110") // Returns (7 + 0i)|0110>
NumberPotential(const List<real> coefficients, const List<integer> sites) -> FermionOperator
Returns an operator representing a weighted sum of number operators .
Parameters
- coefficients: The coefficients .
- sites: The site indices where the operator acts.
Example
var sites = [0,2,3]
var coefficients = [1.0,3.0,4.0]
NumberPotential(coefficients,sites)*Fbit("0110") // Returns (3 + 0i)|0110>
NumberSum(const List<integer> sites) -> FermionOperator
Returns the sum of fermionic number operators with support on the specified sites.
Parameters
- sites: The sites where the operator acts.
Example
NumberSum([0,1,2])*Fbit("0110") // Returns (2 + 0i)|0110>
PairHop(integer i, integer j, integer k, integer l) -> FermionOperator
Returns the pair hopping operator with support on the specified sites.
Parameters
- i: The first creation site index.
- j: The second creation site index.
- k: The first annihilation site index.
- l: The second annihilation site index.
Example
PairHop(0,1,2,3)*Fbit("0110") // Returns (0 + 0i)|0110>
PairHopSum(const RealTensor tensor) -> FermionOperator
Returns a generalized pair hopping tensor operator .
The operator is parametrized by a 4-rank tensor with elements. It acts directly according to the provided index positions, mapping exactly 1-to-1 with the underlying qubit sites.
Note the difference to CoulombSum: PairHopSum does not make any assumptions about interleaved spin mappings. The operator natively preserves particle number.
Parameters
- tensor: The 4-rank tensor representing the interaction.
PairHopSum(const ComplexTensor tensor) -> FermionOperator
Returns a generalized pair hopping tensor operator .
The operator is parametrized by a 4-rank tensor with elements. It acts directly according to the provided index positions, mapping exactly 1-to-1 with the underlying qubit sites.
Note the difference to CoulombSum: PairHopSum does not make any assumptions about interleaved spin mappings. The operator natively preserves particle number.
Parameters
- tensor: The 4-rank tensor representing the interaction.
PairRotation(real angle, integer i, integer j) -> FermionOperator
Returns the pair rotation operator with support on the specified sites.
Parameters
- angle: The rotation angle in radians.
- i: The first site index.
- j: The second site index.
Example
PairRotation(pi/2,0,1)*Fbit("0000") // Returns (0 + 1i)|1100>
PairTransfer(integer i, integer j, integer k, integer l) -> FermionOperator
Returns the directed pair transfer operator with support on the specified sites.
Parameters
- i: The first creation site index.
- j: The second creation site index.
- k: The first annihilation site index.
- l: The second annihilation site index.
Example
PairTransfer(0,1,2,3)*Fbit("0110") // Returns (0 + 0i)|0110>
PhaseHop(real angle, integer i, integer j) -> FermionOperator
Returns the complex phase-hop operator with support on the specified sites.
Parameters
- angle: The phase angle in radians.
- i: The first site index.
- j: The second site index.
Example
PhaseHop(0.0,0,1)*Fbit("1000") // Returns (1 + 0i)|0100>
TransferNumber(integer i, integer j, integer k) -> FermionOperator
Returns the transfer-number operator with support on the specified sites.
Parameters
- i: The creation site index.
- j: The annihilation site index.
- k: The number operator site index.
Example
TransferNumber(0,1,2)*Fbit("0110") // Returns (1 + 0i)|1110>
Constructors
FermionOperator(const FermionOperator other) -> FermionOperator
Copy constructor for FermionOperator. Creates a new instance of the same type as the original operator.
Parameters
- other: The original FermionOperator to copy.
Returns
A new instance of the same type as the original operator.
Members
| Name | Description |
|---|---|
| get_bdg_matrix | Constructs the Bogoliubov-De Gennes matrix representation of a quadratic fermion operator. |
| get_bdg_shift | Extracts the energy shift from a quadratic fermion operator. |
| parameters | Returns the parameter payload of a fermion operator. Parameterized operators return a list, rank-4 tensor operators return a tensor, quadratic operators return a sparse matrix, and named operators return an undefined value. |
| sites | Returns the sites of a fermion operator in definition order. Unlike support(), this preserves the order of sites as they appear in the operator definition. Note: This function only works with fermion operators. For OperatorProduct or OperatorSum, use support() instead. Important: The order returned is the constructor order, not necessarily the order of mathematical application. |