Symbolic operator algebra#
Operator#
Public names: edinpy.fermion.Operator and edinpy.boson.Operator.
- class edinpy.fermion.Operator[source]#
Base class for symbolic second-quantized operator expressions.
Operator expressions support scalar multiplication, addition, subtraction, ordered products, Hermitian conjugation through
dag, and direct action on compatible Fock states or basis-aware Fock vectors.- property string#
Compact symbolic representation.
- Type:
str
OperatorSum#
Public names: edinpy.fermion.OperatorSum and edinpy.boson.OperatorSum.
- class edinpy.fermion.OperatorSum(terms)[source]#
Finite symbolic sum of operator expressions.
- Parameters:
terms (iterable of Operator or numbers.Number) – Additive terms. Nested
OperatorSumobjects are flattened and numerical scalars are promoted to symbolic scalar operators.
- property string#
Compact symbolic representation.
- Type:
str
OperatorProduct#
Public names: edinpy.fermion.OperatorProduct and
edinpy.boson.OperatorProduct.
- class edinpy.fermion.OperatorProduct(factors)[source]#
Ordered symbolic product of operator expressions.
- Parameters:
factors (iterable of Operator or numbers.Number) – Factors written in operator order. The rightmost factor acts first on a ket. Nested products are flattened and numerical factors are collected into one scalar coefficient.
- property string#
Compact symbolic representation.
- Type:
str
set_notation#
Public names: edinpy.fermion.set_notation and
edinpy.boson.set_notation.
- edinpy.fermion.set_notation(operator_type, modes)[source]#
Bind a primitive operator class to a mode specification.
- Parameters:
operator_type (type) – Primitive creation, annihilation, or number-operator class compatible with
modes.modes (FermionModes or BosonModes) – Ordered mode specification used to resolve integer mode indices or degree-of-freedom coordinates.
- Returns:
Callable shorthand. For example,
c = set_notation(Annihilation, modes)allowsc(site, spin)instead ofAnnihilation((site, spin), modes=modes).- Return type:
OperatorNotation