Skip to main content

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 P(i,j)P(i,j) of size L×LL \times L. Each entry P(i,j)P(i,j) for i<ji < j corresponds to the operator P(i,j)fifjP(i,j) f_i^\dagger f_j^\dagger, whilst each entry P(i,j)P(i,j) for i>ji > j corresponds to the operator P(i,j)fifjP(i,j) f_i f_j. The PairingSum operator represents the sum i<jPi,jfifj+i>jPi,jfifj\sum_{i<j}P_{i,j}f_i^{\dagger}f_j^{\dagger} + \sum_{i>j}P_{i,j}f_if_j

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 P(i,j)P(i,j) of size L×LL \times L. Each entry P(i,j)P(i,j) for i<ji < j corresponds to the operator P(i,j)fifjP(i,j) f_i^\dagger f_j^\dagger, whilst each entry P(i,j)P(i,j) for i>ji > j corresponds to the operator P(i,j)fifjP(i,j) f_i f_j. The PairingSum operator represents the sum i<jPi,jfifj+i>jPi,jfifj\sum_{i<j}P_{i,j}f_i^{\dagger}f_j^{\dagger} + \sum_{i>j}P_{i,j}f_if_j

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 P(i,j)P(i,j) of size L×LL \times L. Each entry P(i,j)P(i,j) for i<ji < j corresponds to the operator P(i,j)fifjP(i,j) f_i^\dagger f_j^\dagger, whilst each entry P(i,j)P(i,j) for i>ji > j corresponds to the operator P(i,j)fifjP(i,j) f_i f_j. The PairingSum operator represents the sum i<jPi,jfifj+i>jPi,jfifj\sum_{i<j}P_{i,j}f_i^{\dagger}f_j^{\dagger} + \sum_{i>j}P_{i,j}f_if_j

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 P(i,j)P(i,j) of size L×LL \times L. Each entry P(i,j)P(i,j) for i<ji < j corresponds to the operator P(i,j)fifjP(i,j) f_i^\dagger f_j^\dagger, whilst each entry P(i,j)P(i,j) for i>ji > j corresponds to the operator P(i,j)fifjP(i,j) f_i f_j. The PairingSum operator represents the sum i<jPi,jfifj+i>jPi,jfifj\sum_{i<j}P_{i,j}f_i^{\dagger}f_j^{\dagger} + \sum_{i>j}P_{i,j}f_if_j

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 P(i,j)P(i,j) of size L×LL \times L. Each entry P(i,j)P(i,j) for i<ji < j corresponds to the operator P(i,j)fifjP(i,j) f_i^\dagger f_j^\dagger, whilst each entry P(i,j)P(i,j) for i>ji > j corresponds to the operator P(i,j)fifjP(i,j) f_i f_j. The PairingSum operator represents the sum i<jPi,jfifj+i>jPi,jfifj\sum_{i<j}P_{i,j}f_i^{\dagger}f_j^{\dagger} + \sum_{i>j}P_{i,j}f_if_j

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 P(i,j)P(i,j) of size L×LL \times L. Each entry P(i,j)P(i,j) for i<ji < j corresponds to the operator P(i,j)fifjP(i,j) f_i^\dagger f_j^\dagger, whilst each entry P(i,j)P(i,j) for i>ji > j corresponds to the operator P(i,j)fifjP(i,j) f_i f_j. The PairingSum operator represents the sum i<jPi,jfifj+i>jPi,jfifj\sum_{i<j}P_{i,j}f_i^{\dagger}f_j^{\dagger} + \sum_{i>j}P_{i,j}f_if_j

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 P(i,j)P(i,j) of size L×LL \times L. Each entry P(i,j)P(i,j) for i<ji < j corresponds to the operator P(i,j)fifjP(i,j) f_i^\dagger f_j^\dagger, whilst each entry P(i,j)P(i,j) for i>ji > j corresponds to the operator P(i,j)fifjP(i,j) f_i f_j. The PairingSum operator represents the sum i<jPi,jfifj+i>jPi,jfifj\sum_{i<j}P_{i,j}f_i^{\dagger}f_j^{\dagger} + \sum_{i>j}P_{i,j}f_if_j

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 S(i,j)S(i,j) of size 2L×2L2L \times 2L . The operator represents the sum i,jSi,j+,fifj+Si,j,+fifj+Si,j+,+fifj+Si,j,fifj\sum_{i,j}S_{i,j}^{+,-}f_i^{\dagger}f_j + S_{i,j}^{-,+}f_if_j^{\dagger} + S_{i,j}^{+,+}f_i^{\dagger}f_j^{\dagger} + S_{i,j}^{-,-}f_if_j with S=(S+,,S+,+S,,S,+)S =\begin{pmatrix}S^{+,-}, S^{+,+} \\ S^{-,-}, S^{-,+} \end{pmatrix}

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 S(i,j)S(i,j) of size 2L×2L2L \times 2L . The operator represents the sum i,jSi,j+,fifj+Si,j,+fifj+Si,j+,+fifj+Si,j,fifj\sum_{i,j}S_{i,j}^{+,-}f_i^{\dagger}f_j + S_{i,j}^{-,+}f_if_j^{\dagger} + S_{i,j}^{+,+}f_i^{\dagger}f_j^{\dagger} + S_{i,j}^{-,-}f_if_j with S=(S+,,S+,+S,,S,+)S =\begin{pmatrix}S^{+,-}, S^{+,+} \\ S^{-,-}, S^{-,+} \end{pmatrix}

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 S(i,j)S(i,j) of size 2L×2L2L \times 2L . The operator represents the sum i,jSi,j+,fifj+Si,j,+fifj+Si,j+,+fifj+Si,j,fifj\sum_{i,j}S_{i,j}^{+,-}f_i^{\dagger}f_j + S_{i,j}^{-,+}f_if_j^{\dagger} + S_{i,j}^{+,+}f_i^{\dagger}f_j^{\dagger} + S_{i,j}^{-,-}f_if_j with S=(S+,,S+,+S,,S,+)S =\begin{pmatrix}S^{+,-}, S^{+,+} \\ S^{-,-}, S^{-,+} \end{pmatrix}

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 S(i,j)S(i,j) of size 2L×2L2L \times 2L . The operator represents the sum i,jSi,j+,fifj+Si,j,+fifj+Si,j+,+fifj+Si,j,fifj\sum_{i,j}S_{i,j}^{+,-}f_i^{\dagger}f_j + S_{i,j}^{-,+}f_if_j^{\dagger} + S_{i,j}^{+,+}f_i^{\dagger}f_j^{\dagger} + S_{i,j}^{-,-}f_if_j with S=(S+,,S+,+S,,S,+)S =\begin{pmatrix}S^{+,-}, S^{+,+} \\ S^{-,-}, S^{-,+} \end{pmatrix}

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 S(i,j)S(i,j) of size 2L×2L2L \times 2L . The operator represents the sum i,jSi,j+,fifj+Si,j,+fifj+Si,j+,+fifj+Si,j,fifj\sum_{i,j}S_{i,j}^{+,-}f_i^{\dagger}f_j + S_{i,j}^{-,+}f_if_j^{\dagger} + S_{i,j}^{+,+}f_i^{\dagger}f_j^{\dagger} + S_{i,j}^{-,-}f_if_j with S=(S+,,S+,+S,,S,+)S =\begin{pmatrix}S^{+,-}, S^{+,+} \\ S^{-,-}, S^{-,+} \end{pmatrix}

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 S(i,j)S(i,j) of size 2L×2L2L \times 2L . The operator represents the sum i,jSi,j+,fifj+Si,j,+fifj+Si,j+,+fifj+Si,j,fifj\sum_{i,j}S_{i,j}^{+,-}f_i^{\dagger}f_j + S_{i,j}^{-,+}f_if_j^{\dagger} + S_{i,j}^{+,+}f_i^{\dagger}f_j^{\dagger} + S_{i,j}^{-,-}f_if_j with S=(S+,,S+,+S,,S,+)S =\begin{pmatrix}S^{+,-}, S^{+,+} \\ S^{-,-}, S^{-,+} \end{pmatrix}

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 S(i,j)S(i,j) of size 2L×2L2L \times 2L . The operator represents the sum i,jSi,j+,fifj+Si,j,+fifj+Si,j+,+fifj+Si,j,fifj\sum_{i,j}S_{i,j}^{+,-}f_i^{\dagger}f_j + S_{i,j}^{-,+}f_if_j^{\dagger} + S_{i,j}^{+,+}f_i^{\dagger}f_j^{\dagger} + S_{i,j}^{-,-}f_if_j with S=(S+,,S+,+S,,S,+)S =\begin{pmatrix}S^{+,-}, S^{+,+} \\ S^{-,-}, S^{-,+} \end{pmatrix}

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 fifjf_{i}^\dagger f_{j} 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 A(i,j) A(i,j) of size L×LL \times L. Each entry A(i,j) A(i,j) corresponds to the operator A(i,j)fifjA(i,j) f_i^\dagger f_j. The TransferSum operator represents the sum i,jAi,jfifj\sum_{i,j}A_{i,j}f_i^{\dagger}f_j.

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 A(i,j) A(i,j) of size L×LL \times L. Each entry A(i,j) A(i,j) corresponds to the operator A(i,j)fifjA(i,j) f_i^\dagger f_j. The TransferSum operator represents the sum i,jAi,jfifj\sum_{i,j}A_{i,j}f_i^{\dagger}f_j.

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 A(i,j) A(i,j) of size L×LL \times L. Each entry A(i,j) A(i,j) corresponds to the operator A(i,j)fifjA(i,j) f_i^\dagger f_j. The TransferSum operator represents the sum i,jAi,jfifj\sum_{i,j}A_{i,j}f_i^{\dagger}f_j.

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 A(i,j) A(i,j) of size L×LL \times L. Each entry A(i,j) A(i,j) corresponds to the operator A(i,j)fifjA(i,j) f_i^\dagger f_j. The TransferSum operator represents the sum i,jAi,jfifj\sum_{i,j}A_{i,j}f_i^{\dagger}f_j.

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 A(i,j) A(i,j) of size L×LL \times L. Each entry A(i,j) A(i,j) corresponds to the operator A(i,j)fifjA(i,j) f_i^\dagger f_j. The TransferSum operator represents the sum i,jAi,jfifj\sum_{i,j}A_{i,j}f_i^{\dagger}f_j.

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 A(i,j) A(i,j) of size L×LL \times L. Each entry A(i,j) A(i,j) corresponds to the operator A(i,j)fifjA(i,j) f_i^\dagger f_j. The TransferSum operator represents the sum i,jAi,jfifj\sum_{i,j}A_{i,j}f_i^{\dagger}f_j.

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 A(i,j) A(i,j) of size L×LL \times L. Each entry A(i,j) A(i,j) corresponds to the operator A(i,j)fifjA(i,j) f_i^\dagger f_j. The TransferSum operator represents the sum i,jAi,jfifj\sum_{i,j}A_{i,j}f_i^{\dagger}f_j.

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 i,j,k,l,σ,σVijklaiσajσakσalσ\sum_{i,j,k,l,\sigma,\sigma'} V_{ijkl} a_{i\sigma}^\dagger a_{j\sigma'}^\dagger a_{k\sigma'} a_{l\sigma}.

The operator is parametrized by a 4-rank tensor VijklV_{ijkl} with (L/2)4(L/2)^4 elements. It acts on a 2L2^{L}-dimensional Hilbert space assuming interleaved spins, where spatial orbital ii corresponds to spin-up position 2i2i and spin-down position 2i+12i+1.

Note the difference to PairHopSum: CoulombSum assumes implicit physical spin degrees of freedom. Spatial orbital indices up to L/2L/2 implicitly expand to cover LL qubit sites.

Parameters

  • tensor: The 4-rank tensor VijklV_{ijkl} representing the interaction.

CoulombSum(const RealTensor tensor) -> FermionOperator

Returns a Coulomb tensor operator sum i,j,k,l,σ,σVijklaiσajσakσalσ\sum_{i,j,k,l,\sigma,\sigma'} V_{ijkl} a_{i\sigma}^\dagger a_{j\sigma'}^\dagger a_{k\sigma'} a_{l\sigma}.

The operator is parametrized by a 4-rank tensor VijklV_{ijkl} with (L/2)4(L/2)^4 elements. It acts on a 2L2^{L}-dimensional Hilbert space assuming interleaved spins, where spatial orbital ii corresponds to spin-up position 2i2i and spin-down position 2i+12i+1.

Note the difference to PairHopSum: CoulombSum assumes implicit physical spin degrees of freedom. Spatial orbital indices up to L/2L/2 implicitly expand to cover LL qubit sites.

Parameters

  • tensor: The 4-rank tensor VijklV_{ijkl} representing the interaction.

Create(integer i) -> FermionOperator

Returns the fermionic creation operator fif_{i}^\dagger 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 fifjf_{i}^\dagger f_{j}^\dagger 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 fif_{i} 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 fifjf_{i}f_{j} 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 fifjfkfl+h.c.f_{i}^\dagger f_{j}^\dagger f_{k} f_{l} + \mathrm{h.c.} 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 fifjfkflf_{i}^\dagger f_{j}^\dagger f_{k} f_{l} 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 fifj+fjfif_{i}^\dagger f_{j} + f_{j}^\dagger f_{i} 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 (fifj+fjfi)nk(f_{i}^\dagger f_{j} + f_{j}^\dagger f_{i}) n_{k} 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 exp(iθ(fifj+fjfi))\exp(i \theta (f_{i}^\dagger f_{j} + f_{j}^\dagger f_{i})) with support on the specified sites.

Parameters

  • angle: The rotation angle heta heta 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 inini+1\sum_{i} n_{i} n_{i+1} 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 inini+2\sum_{i} n_{i} n_{i+2} 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 ni=fifin_{i} = f_{i}^\dagger f_{i} 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 isitesni\sum_{i \in \mathrm{sites}} n_{i} 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 ninj=fififjfjn_{i} n_{j} = f_{i}^\dagger f_{i} f_{j}^\dagger f_{j} 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 inini+1\sum_{i} n_{i} n_{i+1} 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 inini+2\sum_{i} n_{i} n_{i+2} 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 exp(iϕninj)\exp(i \phi n_{i} n_{j}) with support on the specified sites.

Parameters

  • angle: The phase angle ϕ\phi 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 exp(iϕni)\exp(i \phi n_i) with support on the specified site.

Parameters

  • angle: The phase angle ϕ\phi 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 i=0N1αini\sum_{i=0}^{N-1} \alpha_i n_i, where the site indices are implicitly 0,1,,N10, 1, \dots, N-1. 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 αi\alpha_i.

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 isitesαini\sum_{i \in \mathrm{sites}} \alpha_i n_i.

Parameters

  • coefficients: The coefficients αi\alpha_i.
  • 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 isitesni\sum_{i \in \mathrm{sites}} n_{i} 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 fifjfkfl+h.c.f_{i}^\dagger f_{j}^\dagger f_{k} f_{l} + \mathrm{h.c.} 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 i,j,k,lVijklaiajakal\sum_{i,j,k,l} V_{ijkl} a_{i}^\dagger a_{j}^\dagger a_{k} a_{l}.

The operator is parametrized by a 4-rank tensor VijklV_{ijkl} with L4L^4 elements. It acts directly according to the provided index positions, mapping exactly 1-to-1 with the underlying LL 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 VijklV_{ijkl} representing the interaction.

PairHopSum(const ComplexTensor tensor) -> FermionOperator

Returns a generalized pair hopping tensor operator i,j,k,lVijklaiajakal\sum_{i,j,k,l} V_{ijkl} a_{i}^\dagger a_{j}^\dagger a_{k} a_{l}.

The operator is parametrized by a 4-rank tensor VijklV_{ijkl} with L4L^4 elements. It acts directly according to the provided index positions, mapping exactly 1-to-1 with the underlying LL 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 VijklV_{ijkl} representing the interaction.

PairRotation(real angle, integer i, integer j) -> FermionOperator

Returns the pair rotation operator exp(iθ(fifj+fjfi))\exp(i \theta (f_{i}^\dagger f_{j}^\dagger + f_{j} f_{i})) with support on the specified sites.

Parameters

  • angle: The rotation angle heta heta 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 fifjfkflf_{i}^\dagger f_{j}^\dagger f_{k} f_{l} 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 eiϕfifj+eiϕfjfie^{i \phi} f_{i}^\dagger f_{j} + e^{-i \phi} f_{j}^\dagger f_{i} with support on the specified sites.

Parameters

  • angle: The phase angle ϕ\phi 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 fifjnkf_{i}^\dagger f_{j} n_{k} 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

Returns

A new instance of the same type as the original operator.

Members

NameDescription
get_bdg_matrixConstructs the Bogoliubov-De Gennes matrix representation of a quadratic fermion operator.
get_bdg_shiftExtracts the energy shift from a quadratic fermion operator.
parametersReturns 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.
sitesReturns 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.