Degrees of freedom

QuantumLattices.DegreesOfFreedom.ConstraintMethod
Constraint{R}() where R
Constraint{R}(condition::Union{Pattern, Diagonal}) where R
Constraint{R}(representation::String, condition::Function) where R

Construct a constraint with only one condition.

source
QuantumLattices.DegreesOfFreedom.CouplingMethod
Coupling(sites::Union{NTuple{N, Int}, Colon}, ::Type{I}, fields::Union{NTuple{N}, Colon}...) where {N, I<:SimpleIID}
Coupling(value, sites::Union{NTuple{N, Int}, Colon}, ::Type{I}, fields::Union{NTuple{N}, Colon}...) where {N, I<:SimpleIID}
Coupling{N}(sites::Union{NTuple{N, Int}, Colon}, ::Type{I}, fields::Union{NTuple{N}, Colon}...) where {N, I<:SimpleIID}
Coupling{N}(value, sites::Union{NTuple{N, Int}, Colon}, ::Type{I}, fields::Union{NTuple{N}, Colon}...) where {N, I<:SimpleIID}

Construct a Coupling with the input sites and the fields of a kind of simple iid.

source
QuantumLattices.DegreesOfFreedom.HilbertMethod
Hilbert(internals::Internal...)
Hilbert(internals::Tuple{Vararg{Internal}})
Hilbert(internals::AbstractVector{<:Internal})

Construct a Hilbert space with the given internals.

source
QuantumLattices.DegreesOfFreedom.MetricType
Metric <: Function

The rules for measuring an operator unit so that different operator units can be compared.

As a function, every instance should accept only one positional argument, i.e. the operator unit to be measured.

source
QuantumLattices.DegreesOfFreedom.TableType
Table(operatorunits::AbstractVector{<:OperatorUnit}, by::Metric=OperatorUnitToTuple(eltype(operatorunits)))

Convert a set of operator units to the corresponding table of operator unit vs. sequence pairs.

The input operator units are measured by the input by function with the duplicates removed. The resulting unique values are sorted, which determines the sequence of the input operatorunits. Note that two operator units have the same sequence if their converted values are equal to each other.

source
QuantumLattices.DegreesOfFreedom.TermMethod
Term{K}(id::Symbol, value, bondkind, coupling, ishermitian::Bool; amplitude::Union{Function, Nothing}=nothing, modulate::Union{Function, Bool}=true) where K

Construct a term.

source
QuantumLattices.DegreesOfFreedom.@indexesMacro
@indexes index₁ index₂ ...
@indexes(index₁, index₂, ...; constraint=...)

Construct an set of indexes and its constraint according to the input index pattern and an optional constraint.

source
Base.:*Method
*(cp₁::Coupling, cp₂::Coupling) -> Coupling

Get the multiplication between two coupling.

source
Base.:*Method
*(mc₁::MatrixCoupling, mc₂::MatrixCoupling) -> MatrixCouplingProd
*(mc::MatrixCoupling, mcp::MatrixCouplingProd) -> MatrixCouplingProd
*(mcp::MatrixCouplingProd, mc::MatrixCoupling) -> MatrixCouplingProd
*(mcp₁::MatrixCouplingProd, mcp₂::MatrixCouplingProd) -> MatrixCouplingProd
*(mc::MatrixCoupling, factor::Number) -> MatrixCouplingProd
*(factor::Number, mc::MatrixCoupling) -> MatrixCouplingProd
*(factor::Number, mcp::MatrixCouplingProd) -> MatrixCouplingProd
*(mcp::MatrixCouplingProd, factor::Number) -> MatrixCouplingProd
*(mcs::MatrixCouplingSum, element::Union{Number, MatrixCoupling, MatrixCouplingProd}) -> MatrixCouplingSum
*(element::Union{Number, MatrixCoupling, MatrixCouplingProd}, mcs::MatrixCouplingSum) -> MatrixCouplingSum
*(mcs₁::MatrixCouplingSum, mcs₂::MatrixCouplingSum) -> MatrixCouplingSum

The product between MatrixCouplings and MatrixCouplingProds.

source
Base.:*Method
*(constraint₁::Constraint, constraint₂::Constraint) -> Constraint

Get the combination of two sets of constraints.

source
Base.:+Method
+(mc₁::Union{MatrixCoupling, MatrixCouplingProd}, mc₂::Union{MatrixCoupling, MatrixCouplingProd}) -> MatrixCouplingSum
+(mc::Union{MatrixCoupling, MatrixCouplingProd}, mcs::MatrixCouplingSum) -> MatrixCouplingSum
+(mcs::MatrixCouplingSum, mc::Union{MatrixCoupling, MatrixCouplingProd}) -> MatrixCouplingSum
+(mcs₁::MatrixCouplingSum, mcs₂::MatrixCouplingSum) -> MatrixCouplingSum

The addition between MatrixCouplings and MatrixCouplingProds.

source
Base.:/Method
/(mcp::MatrixCouplingProd, factor::Number) -> MatrixCouplingProd
/(mcs::MatrixCouplingSum, factor::Number) -> MatrixCouplingSum
/(mc::MatrixCoupling, factor::Number) -> MatrixCouplingProd
//(mcp::MatrixCouplingProd, factor::Number) -> MatrixCouplingProd
//(mcs::MatrixCouplingSum, factor::Number) -> MatrixCouplingSum
//(mc::MatrixCoupling, factor::Number) -> MatrixCouplingProd
-(mc::MatrixCoupling) -> MatrixCouplingProd
-(mcp::MatrixCouplingProd) -> MatrixCouplingProd
-(mcs::MatrixCouplingSum) -> MatrixCouplingSum
-(mc₁::Union{MatrixCoupling, MatrixCouplingProd}, mc₂::Union{MatrixCoupling, MatrixCouplingProd}) -> MatrixCouplingSum
-(mc::Union{MatrixCoupling, MatrixCouplingProd}, mcs::MatrixCouplingSum) -> MatrixCouplingSum
-(mcs::MatrixCouplingSum, mc::Union{MatrixCoupling, MatrixCouplingProd}) -> MatrixCouplingSum
-(mcs₁::MatrixCouplingSum, mcs₂::MatrixCouplingSum) -> MatrixCouplingSum

Define right-division, minus and subtraction operator.

source
Base.:^Method
^(mc::Union{MatrixCoupling, MatrixCouplingProd, MatrixCouplingSum}, n::Int) -> Union{MatrixCoupling, MatrixCouplingProd, MatrixCouplingSum}

Get the nth power of a MatrixCoupling/MatrixCouplingProd/MatrixCouplingSum.

source
Base.adjointMethod
adjoint(index::CompositeIndex) -> typeof(index)

Get the adjoint of an operator id.

source
Base.adjointMethod
adjoint(index::Index) -> typeof(index)

Get the adjoint of an index.

source
Base.filterMethod
filter(iid::SimpleIID, ci::CompositeInternal) -> Union{Nothing, SimpleInternal, CompositeInternal}
filter(::Type{I}, ci::CompositeInternal) where {I<:SimpleIID} -> Union{Nothing, SimpleInternal, CompositeInternal}

Filter the composite internal space and select those that matches I or the type of iid.

source
Base.filterMethod
filter(iid::SimpleIID, i::SimpleInternal) -> Union{Nothing, typeof(i)}
filter(::Type{I}, i::SimpleInternal) where {I<:SimpleIID} -> Union{Nothing, typeof(i)}

Filter a simple internal space with respect to the input iid or type I.

source
Base.filterMethod
filter(iid::SimpleIID, ::Type{C}) where {C<:CompositeInternal}
filter(::Type{I}, ::Type{C}) where {I<:SimpleIID, C<:CompositeInternal}

Filter the type of a composite internal space and select those that matches I or the type of iid.

source
Base.filterMethod
filter(iid::SimpleIID, ::Type{T}) where {T<:SimpleInternal}
filter(::Type{I}, ::Type{T}) where {I<:SimpleIID, T<:SimpleInternal}

Filter the type of a simple internal space with respect to the input iid or type I.

source
Base.getindexMethod
getindex(table::Table, operatorunit::OperatorUnit) -> Int

Inquiry the sequence of an operator unit.

source
Base.haskeyMethod
haskey(table::Table, operatorunit::OperatorUnit) -> Bool
haskey(table::Table, operatorunits::ID{OperatorUnit}) -> Tuple{Vararg{Bool}}

Judge whether a single operator unit or a set of operator units have been assigned with sequences in table.

source
Base.keysMethod
keys(bound::Boundary) -> Tuple{Vararg{Symbol}}
keys(::Type{<:Boundary{Names}}) where Names -> Names

Get the names of the boundary parameters.

source
Base.keysMethod
keys(::OperatorUnitToTuple{Fields}) where Fields -> Fields
keys(::Type{<:OperatorUnitToTuple{Fields}}) where Fields -> Fields

Get the names of the selected fields.

source
Base.matchMethod
match(iid::SimpleIID, i::SimpleInternal) -> Bool
match(::Type{I}, ::Type{SI}) where {I<:SimpleIID, SI<:SimpleInternal}

Judge whether a simple iid or a simple iid type matches a simple internal space or a simple internal space type.

Here, "match" means that the eltype of the simple internal space has the same type name with the simple iid.

source
Base.matchMethod
match(constraint::Constraint, indexes::Tuple{Vararg{Index}}) -> Bool

Judge whether a composite iid fulfills a constraint.

source
Base.merge!Method
merge!(bound::Boundary, another::Boundary) -> typeof(bound)

Merge the values and vectors of the twisted boundary condition from another one.

source
Base.replaceMethod
replace(bound::Boundary; values=bound.values, vectors=bound.vectors) -> Boundary

Replace the values or vectors of a twisted boundary condition and get the new one.

Note

The plain boundary condition keeps plain even when replaced with new values or new vectors.

source
Base.replaceMethod
replace(term::Term; kwargs...) -> Term

Replace some attributes of a term with key word arguments.

source
Base.reprMethod
repr(term::Term, bond::Bond, hilbert::Hilbert) -> String

Get the repr representation of a term on a bond with a given Hilbert space.

source
Base.unionMethod
union(tables::Table...) -> Table

Unite several operator unit vs. sequence tables.

source
Base.valtypeMethod
valtype(term::Term)
valtype(::Type{<:Term)

Get the value type of a term.

source
Base.valtypeMethod
valtype(::Type{<:OperatorUnitToTuple}, ::Type{<:Index})

Get the valtype of applying an OperatorUnitToTuple rule to an Index.

source
LinearAlgebra.rankMethod
rank(ciid::CompositeIID) -> Int
rank(::Type{<:CompositeIID{T}}) where {T<:Tuple{Vararg{SimpleIID}}} -> Int

Get the number of simple iids in a composite iid.

source
LinearAlgebra.rankMethod
rank(ci::CompositeInternal) -> Int
rank(::Type{<:CompositeInternal{K, T}}) where {K, T<:Tuple{Vararg{SimpleInternal}}} -> Int

Get the number of simple internal spaces in a composite internal space.

source
LinearAlgebra.rankMethod
rank(constraint::Constraint, i::Integer) -> Int
rank(::Type{<:Constraint{RS}}, i::Integer) where RS -> Int

Get the rank of the ith homogenous segment of the coupling indexes that a constraint can apply.

source
LinearAlgebra.rankMethod
rank(constraint::Constraint) -> Int
rank(::Type{<:Constraint{RS}}) where RS -> Int

Get the rank of the coupling indexes that a constraint can apply.

source
QuantumLattices.:⊕Method
⊕(i₁::SimpleInternal, i₂::SimpleInternal) -> CompositeInternal{:⊕}
⊕(i::SimpleInternal, ci::CompositeInternal{:⊕}) -> CompositeInternal{:⊕}
⊕(ci::CompositeInternal{:⊕}, i::SimpleInternal) -> CompositeInternal{:⊕}
⊕(ci₁::CompositeInternal{:⊕}, ci₂::CompositeInternal{:⊕}) -> CompositeInternal{:⊕}

Direct product between simple internal spaces and composite internal spaces.

source
QuantumLattices.:⊗Method
⊗(iid₁::SimpleIID, iid₂::SimpleIID) -> CompositeIID
⊗(iid::SimpleIID, ciid::CompositeIID) -> CompositeIID
⊗(ciid::CompositeIID, iid::SimpleIID) -> CompositeIID
⊗(ciid₁::CompositeIID, ciid₂::CompositeIID) -> CompositeIID

Direct product between simple iids and composite iids.

source
QuantumLattices.:⊗Method
⊗(i₁::SimpleInternal, i₂::SimpleInternal) -> CompositeInternal{:⊗}
⊗(i::SimpleInternal, ci::CompositeInternal{:⊗}) -> CompositeInternal{:⊗}
⊗(ci::CompositeInternal{:⊗}, i::SimpleInternal) -> CompositeInternal{:⊗}
⊗(ci₁::CompositeInternal{:⊗}, ci₂::CompositeInternal{:⊗}) -> CompositeInternal{:⊗}

Direct product between simple internal spaces and composite internal spaces.

source
QuantumLattices.DegreesOfFreedom.iidtypeMethod
iidtype(ciid::CompositeIID, i::Integer)
iidtype(::Type{<:CompositeIID{T}}, i::Integer) where {T<:Tuple{Vararg{SimpleIID}}}

Get the type of the ith simple iid in a composite iid.

source
QuantumLattices.DegreesOfFreedom.sitestructureMethod
sitestructure(::Val{termkind}, ::Val{termrank}, bondlength::Integer) where {termkind, termrank} -> NTuple{termrank, Int}

Get the site structure, i.e. the acting centers of the coupling on a bond, of a certain kind of term.

source
QuantumLattices.QuantumOperators.scriptMethod
script(::Val{:rcoordinate}, index::CompositeIndex; kwargs...) -> String
script(::Val{:icoordinate}, index::CompositeIndex; kwargs...) -> String

Get the rcoordinate/icoordinate script of a composite index.

source
QuantumLattices.expand!Method
expand!(operators::Operators, term::Term, bond::Bond, hilbert::Hilbert; half::Bool=false) -> Operators
expand!(operators::Operators, term::Term, bonds, hilbert::Hilbert; half::Bool=false) -> Operators

Expand the operators of a term on a bond/set-of-bonds with a given Hilbert space.

The half parameter determines the behavior of generating operators, which falls into the following two categories

  • true: "Hermitian half" of the generated operators
  • false: "Hermitian whole" of the generated operators
source
QuantumLattices.expandMethod
expand(iid::SimpleIID, internal::SimpleInternal) -> IIDSpace
expand(iids::NTuple{N, SimpleIID}, internals::NTuple{N, SimpleInternal}) where N -> IIDSpace

Get the space expanded by a set of "labeled" iids.

source
QuantumLattices.expandMethod
expand(term::Term, bond::Bond, hilbert::Hilbert; half::Bool=false) -> Operators
expand(term::Term, bonds, hilbert::Hilbert; half::Bool=false) -> Operators

Expand the operators of a term on a bond/set-of-bonds with a given Hilbert space.

source
QuantumLattices.expandMethod
expand(::Val{termkind}, coupling::Coupling, bond::Bond, hilbert::Hilbert) where termkind

Expand a coupling with the given bond and Hilbert space of a certain kind of term.

source
QuantumLattices.permuteMethod
permute(index₁::CompositeIndex, index₂::CompositeIndex) -> Tuple{Vararg{Operator}}

Get the permutation of two composite indexes.

source
QuantumLattices.reset!Method
reset!(table::Table, operatorunits::AbstractVector{<:OperatorUnit}) -> Table

Reset a table by a new set of operatorunits.

source