qrunch.quantum.operators.second_quantization.fermion
Module that contains the abstract fermion operators \(\hat{a}\) and \(\hat{a}^{\dagger}\).
A general second quantized fermionic Hamiltonian operator can be expressed as a combination of these fundamental operators through addition and multiplication, applied to specific qubits.
from qrunch.quantum.operators.second_quantization.fermion import FermionCreation, FermionAnnihilation
Obs = 0.5 * FermionCreation(1) * FermionAnnihilation(1)
- 0.7 * FermionCreation(1) * FermionCreation(2) * FermionAnnihilation(3) * FermionAnnihilation(4)
A Hamiltonian like this can then be mapped to Pauli operators (which can be used in e.g. estimators), by using e.g. the Jordan-Wigner mapper.
Classes
Fermion annihilation operator acting on a specific site. |
|
Fermion creation operator acting on a specific site. |
- class FermionAnnihilation
Bases:
FermionOperatorFermion annihilation operator acting on a specific site.
- __init__(site: AbstractIndex | int) None
Initialize the fermion operator on a specific site.
- Parameters:
site (AbstractIndex | int) – The site to act upon.
- Return type:
None
- get_indices() tuple[AbstractIndex | int]
Get indices of the operator.
Returns: Indices of the operator
- Return type:
tuple[AbstractIndex | int]
- property site: AbstractIndex | int
The site the operator acts on.
- with_indices(index_value_pairs: IndexValuePairs) FermionOperator
Create a new copy of the operator with the AbstractIndex set to the given value.
- Parameters:
index_value_pairs (IndexValuePairs) – Map of abstract indices to concrete values.
- Return type:
Returns: New copy of the operator with the AbstractIndex set to the given value.
- class FermionCreation
Bases:
FermionOperatorFermion creation operator acting on a specific site.
- __init__(site: AbstractIndex | int) None
Initialize the fermion operator on a specific site.
- Parameters:
site (AbstractIndex | int) – The site to act upon.
- Return type:
None
- get_indices() tuple[AbstractIndex | int]
Get indices of the operator.
Returns: Indices of the operator
- Return type:
tuple[AbstractIndex | int]
- property site: AbstractIndex | int
The site the operator acts on.
- with_indices(index_value_pairs: IndexValuePairs) FermionOperator
Create a new copy of the operator with the AbstractIndex set to the given value.
- Parameters:
index_value_pairs (IndexValuePairs) – Map of abstract indices to concrete values.
- Return type:
Returns: New copy of the operator with the AbstractIndex set to the given value.
Modules
Base class for all fermion operators, which define internal logic. |
|
A compact representation of a fermionic operator consisting only of single and double excitations. |