Expressions with creation/annihilation operators of fermions

KeldyshED.OperatorsModule

This module implements an algebra of fermionic creation/annihilation operators and polynomial expressions built out of such operators.

source

Canonical operators

KeldyshED.Operators.IndicesTypeType
mutable struct Array{Union{Int64, String}, 1} <: DenseVector{Union{Int64, String}}

Compound operator index $\alpha$ as a mixed list of String / Int indices.

source
KeldyshED.Operators.CanonicalOperatorType

This structure represents a single creation operator $c^\dagger_\alpha$ or an annihilation operator $c_\alpha$.

Fields

  • dagger::Bool: Creation operator if true, annihilation operator otherwise

  • indices::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$.

source
KeldyshED.Operators.daggerMethod
dagger(
    op::KeldyshED.Operators.CanonicalOperator
) -> KeldyshED.Operators.CanonicalOperator

Hermitian conjugate of a canonical operator.

source
KeldyshED.Operators.isconjugateMethod
isconjugate(
    op1::KeldyshED.Operators.CanonicalOperator,
    op2::KeldyshED.Operators.CanonicalOperator
) -> Bool

Check if op2 is a Hermitian conjugate of op1.

source
Base.showMethod
show(io::IO, op::KeldyshED.Operators.CanonicalOperator)

Print a canonical operator.

source

Monomials

KeldyshED.Operators.MonomialType

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.

source
Base.lengthMethod
length(m::KeldyshED.Operators.Monomial) -> Int64

Number of canonical operators in a given monomial.

source
Base.isemptyMethod
isempty(m::KeldyshED.Operators.Monomial) -> Any

Check if a given monomial is 1, i.e. a product of zero canonical operators.

source
Base.showMethod
show(io::IO, m::KeldyshED.Operators.Monomial)

Print a monomial.

source

Polynomial expressions

KeldyshED.Operators.OperatorExprType

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}.

source
KeldyshED.Operators.scalartypeFunction
scalartype(_::KeldyshED.Operators.OperatorExpr{S}) -> Any

Determine the type of monomial coefficients of a given polynomial expression.

source
scalartype(
    _::Type{KeldyshED.Operators.OperatorExpr{S}}
) -> Any

Determine the type of monomial coefficients of a given polynomial expression type.

source
KeldyshED.Operators.daggerMethod
dagger(
    op::KeldyshED.Operators.OperatorExpr{S}
) -> KeldyshED.Operators.OperatorExpr

Hermitian conjugate of a polynomial expression.

source
Base.iszeroMethod
iszero(op::KeldyshED.Operators.OperatorExpr{S}) -> Bool

Check if a given polynomial expression is identically zero.

source
Base.lengthMethod
length(op::KeldyshED.Operators.OperatorExpr) -> Int64

Number of monomials in a given polynomial expression op.

source
Base.isemptyMethod
isempty(op::KeldyshED.Operators.OperatorExpr) -> Bool

Check if a given polynomial expression is identically zero.

source
Base.mapMethod
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.

source
Base.realMethod
real(
    op::KeldyshED.Operators.OperatorExpr
) -> KeldyshED.Operators.OperatorExpr

Return a version of a polynomial expression op with all coefficients replaced by their real parts.

source
Base.imagMethod
imag(
    op::KeldyshED.Operators.OperatorExpr
) -> KeldyshED.Operators.OperatorExpr

Return a version of a polynomial expression op with all coefficients replaced by their imaginary parts.

source
Base.showMethod
show(io::IO, op::KeldyshED.Operators.OperatorExpr{S}) -> Any

Print a polynomial expression.

source

Factory functions for polynomial expressions

KeldyshED.Operators.cFunction
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).

source
KeldyshED.Operators.c_dagFunction
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).

source
KeldyshED.Operators.nFunction
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).

source