Expressions with creation/annihilation operators of fermions
KeldyshED.Operators — Module
This module implements an algebra of fermionic creation/annihilation operators and polynomial expressions built out of such operators.
Canonical operators
KeldyshED.Operators.IndicesType — Type
mutable struct Array{Union{Int64, String}, 1} <: DenseVector{Union{Int64, String}}Compound operator index $\alpha$ as a mixed list of String / Int indices.
KeldyshED.Operators.CanonicalOperator — Type
This structure represents a single creation operator $c^\dagger_\alpha$ or an annihilation operator $c_\alpha$.
Fields
dagger::Bool: Creation operator iftrue, annihilation operator otherwiseindices::Vector{Union{Int64, String}}: Compound index α carried by the operator
Canonical operators are less-comparable and are ordered according to the following rule,
$c^\dagger_\alpha < c^\dagger_\beta < c^\dagger_\gamma < c_\gamma < c_\beta < c_\alpha,$
where compound indices satisfy $\alpha < \beta < \gamma$.
KeldyshED.Operators.dagger — Method
dagger(
op::KeldyshED.Operators.CanonicalOperator
) -> KeldyshED.Operators.CanonicalOperator
Hermitian conjugate of a canonical operator.
KeldyshED.Operators.isconjugate — Method
isconjugate(
op1::KeldyshED.Operators.CanonicalOperator,
op2::KeldyshED.Operators.CanonicalOperator
) -> Bool
Check if op2 is a Hermitian conjugate of op1.
Monomials
KeldyshED.Operators.Monomial — Type
An ordered product of canonical operators.
Fields
ops::Vector{KeldyshED.Operators.CanonicalOperator}: List of canonical operators in the product, left-to-right.
Monomials are less-comparable, with a shorter monomial being always considered lesser than a longer one.
Base.length — Method
length(m::KeldyshED.Operators.Monomial) -> Int64
Number of canonical operators in a given monomial.
Base.isempty — Method
isempty(m::KeldyshED.Operators.Monomial) -> Any
Check if a given monomial is 1, i.e. a product of zero canonical operators.
KeldyshED.Operators.dagger — Method
dagger(
m::KeldyshED.Operators.Monomial
) -> KeldyshED.Operators.Monomial
Hermitian conjugate of a monomial.
Polynomial expressions
KeldyshED.Operators.OperatorExpr — Type
Polynomial expression built out of canonical operators and numeric coefficients,
$M^{(0)} + \sum_\alpha M^{(1)}_\alpha o_\alpha + \sum_{\alpha\beta} M^{(2)}_{\alpha\beta} o_\alpha o_\beta + \sum_{\alpha\beta\gamma} M^{(3)}_{\alpha\beta\gamma} o_\alpha o_\beta o_\gamma + \ldots,$
where $o_\alpha$ are canonical operators $c^\dagger_\alpha$ / $c_\alpha$, and $M^{(n)}$ are the coefficients.
Fields
monomials::DataStructures.SortedDict{KeldyshED.Operators.Monomial, ScalarType} where ScalarType<:Number: Sorted list of monomials with numeric coefficients $M^{(n)}$ in front of them.
Polynomial expressions support the following arithmetic operations.
- Addition / subtraction of two expressions with the same coefficient type.
- Multiplication of two expressions with the same coefficient type.
- Addition / subtraction of a constant.
- Multiplication / division by a constant.
- Unary minus.
They also support the iteration interface with iteration element type being Pair{Monomial, ScalarType}.
KeldyshED.Operators.OperatorExpr — Method
OperatorExpr{S}(x::S) where {S <: Number}Construct a polynomial expression with coefficient type S identically equal to x.
KeldyshED.Operators.RealOperatorExpr — Type
struct OperatorExpr{Float64}Polynomial expression with real coefficients.
KeldyshED.Operators.ComplexOperatorExpr — Type
struct OperatorExpr{ComplexF64}Polynomial expression with complex coefficients.
KeldyshED.Operators.scalartype — Function
scalartype(_::KeldyshED.Operators.OperatorExpr{S}) -> Any
Determine the type of monomial coefficients of a given polynomial expression.
scalartype(
_::Type{KeldyshED.Operators.OperatorExpr{S}}
) -> Any
Determine the type of monomial coefficients of a given polynomial expression type.
KeldyshED.Operators.dagger — Method
dagger(
op::KeldyshED.Operators.OperatorExpr{S}
) -> KeldyshED.Operators.OperatorExpr
Hermitian conjugate of a polynomial expression.
Base.iszero — Method
iszero(op::KeldyshED.Operators.OperatorExpr{S}) -> Bool
Check if a given polynomial expression is identically zero.
Base.length — Method
length(op::KeldyshED.Operators.OperatorExpr) -> Int64
Number of monomials in a given polynomial expression op.
Base.isempty — Method
isempty(op::KeldyshED.Operators.OperatorExpr) -> Bool
Check if a given polynomial expression is identically zero.
Base.map — Method
map(
f,
op::KeldyshED.Operators.OperatorExpr{S}
) -> KeldyshED.Operators.OperatorExpr
Transform a given polynomial expression op by applying a function f to coefficients of all monomials in the expression. If f applied to a coefficient returns zero, the corresponding monomial is omitted from the resulting expression.
Factory functions for polynomial expressions
KeldyshED.Operators.c — Function
c(
indices...;
scalar_type
) -> KeldyshED.Operators.RealOperatorExpr
Make an annihilation operator $c_\alpha$ with indices... being components of the compound index $\alpha$. Coefficient type of the resulting polynomial expression can be specified via scalar_type (defaults to Float64).
KeldyshED.Operators.c_dag — Function
c_dag(
indices...;
scalar_type
) -> KeldyshED.Operators.RealOperatorExpr
Make an creation operator $c^\dagger_\alpha$ with indices... being components of the compound index $\alpha$. Coefficient type of the resulting polynomial expression can be specified via scalar_type (defaults to Float64).
KeldyshED.Operators.n — Function
n(
indices...;
scalar_type
) -> KeldyshED.Operators.RealOperatorExpr
Make a particle number operator $n_\alpha = c^\dagger_\alpha c_\alpha$ with indices... being components of the compound index $\alpha$. Coefficient type of the resulting polynomial expression can be specified via scalar_type (defaults to Float64).