fermion
eigenkit.chemistry.fermion
Fermionic operators: linear combinations of products of creation / annihilation operators on spin-orbital modes.
Conventions (OpenFermion-compatible):
- A mode is a spin-orbital, indexed 0 .. M-1.
- A ladder operator is (mode, action) with action = 1 for creation
\(a_{\text{mode}}^\dagger\) and action = 0 for annihilation a_mode.
- A term is a tuple of ladder operators applied left-to-right, e.g.
\(a_2^\dagger a_0\) is ((2, 1), (0, 0)).
Operators are NOT normal-ordered (the Jordan-Wigner map handles raw products directly), so \(a_p^\dagger a_q\) and \(a_q a_p^\dagger\) are stored as written.
FermionOperator
A complex linear combination of fermionic terms, stored as {term: coeff}.
__init__(terms=None)
Build an operator from a mapping of terms to coefficients.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
terms
|
dict[Term, complex] | None
|
Maps each term to its coefficient. A term is a tuple of
|
None
|
annihilation(mode)
classmethod
The annihilation operator a_mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
int
|
The index of the spin-orbital from which an electron is removed. |
required |
Returns:
| Type | Description |
|---|---|
'FermionOperator'
|
The operator, as a |
creation(mode)
classmethod
The creation operator a†_mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
int
|
The index of the spin-orbital in which an electron is created. |
required |
Returns:
| Type | Description |
|---|---|
'FermionOperator'
|
The operator, as a |
hermitian_conjugate()
The adjoint of the operator.
The order of each term is reversed, creation and annihilation are swapped, and each coefficient is replaced by its complex conjugate.
Returns:
| Type | Description |
|---|---|
'FermionOperator'
|
The adjoint, as a |
identity(coefficient=1.0)
classmethod
The identity operator, optionally scaled.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coefficient
|
Scalar
|
The factor that multiplies the identity. The default is |
1.0
|
Returns:
| Type | Description |
|---|---|
'FermionOperator'
|
The scaled identity, as a |
number(mode)
classmethod
The number operator a†_mode a_mode.
It counts the electrons in one spin-orbital.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
int
|
The index of the spin-orbital. |
required |
Returns:
| Type | Description |
|---|---|
'FermionOperator'
|
The operator, as a |
zero()
classmethod
The zero operator, which has no terms.
Returns:
| Type | Description |
|---|---|
'FermionOperator'
|
The zero |