Frameworks

QuantumLattices.Frameworks.AlgorithmType
(alg::Algorithm)(assign::Assignment, checkoptions::Bool=true; options...) -> Assignment
(assign::Assignment)(alg::Algorithm, checkoptions::Bool=true; options...) -> Assignment

Run an assignment based on an algorithm.

The difference between these two methods is that the first uses the parameters of assign as the current parameters while the second uses those of alg.

source
QuantumLattices.Frameworks.AlgorithmType
Algorithm(name::Symbol, frontend::Frontend, parameters::Parameters=Parameters(frontend), map::Function=identity; dir::String=".", timer::TimerOutput=TimerOutput())

Construct an algorithm.

source
QuantumLattices.Frameworks.AlgorithmMethod
(alg::Algorithm)(name::Symbol, action::Action, dependencies::ZeroOrMore{Assignment}; dir::String=alg.dir, delay::Bool=false, options...) -> Assignment
(alg::Algorithm)(name::Symbol, action::Action, parameters::Parameters, dependencies::ZeroOrMore{Assignment}; dir::String=alg.dir, delay::Bool=false, options...) -> Assignment
(alg::Algorithm)(name::Symbol, action::Action, parameters::Parameters=Parameters(), map::Function=identity, dependencies::ZeroOrMore{Assignment}=(); dir::String=alg.dir, delay::Bool=false, options...) -> Assignment

Add an assignment on an algorithm by providing the contents of the assignment, and run this assignment.

source
QuantumLattices.Frameworks.CategorizedGeneratorType
CategorizedGenerator{V, C, A<:NamedTuple, B<:NamedTuple, P<:Parameters, D<:Boundary} <: ParametricGenerator{V}

Parameterized generator that groups the (representations of) quantum operators in a quantum lattice system into three categories, i.e., the constant, the alterable, and the boundary.

source
QuantumLattices.Frameworks.GeneratorMethod
Generator(ops::OperatorSet) -> StaticGenerator
Generator(constops, alterops::NamedTuple, boundops::NamedTuple, parameters::Parameters, boundary::Boundary) -> CategorizedGenerator
Generator(ops::CategorizedGenerator{<:Operators}, bonds::Vector{<:Bond}, hilbert::Hilbert, terms::OneOrMore{Term}, half::Bool) -> OperatorGenerator
Generator(bonds::Vector{<:Bond}, hilbert::Hilbert, terms::OneOrMore{Term}, boundary::Boundary=plain; half::Bool=false) -> OperatorGenerator

Factory constructor for Generator subtypes.

Dispatches on the argument types to construct the appropriate concrete representation. Unlike LatticeModel, this factory only constructs Generator subtypes (not Formula).

source
QuantumLattices.Frameworks.LatticeModelType
LatticeModel

Abstract supertype for all representations of a quantum lattice system.

Subtypes must implement valtype. Parameters and update! should also be implemented as applicable.

source
QuantumLattices.Frameworks.LatticeModelMethod
LatticeModel(expression::Function, parameters::Parameters) -> Formula
LatticeModel(ops::OperatorSet) -> StaticGenerator
LatticeModel(constops, alterops::NamedTuple, boundops::NamedTuple, parameters::Parameters, boundary::Boundary) -> CategorizedGenerator
LatticeModel(ops::CategorizedGenerator{<:Operators}, bonds::Vector{<:Bond}, hilbert::Hilbert, terms::OneOrMore{Term}, half::Bool) -> OperatorGenerator
LatticeModel(bonds::Vector{<:Bond}, hilbert::Hilbert, terms::OneOrMore{Term}, boundary::Boundary=plain; half::Bool=false) -> OperatorGenerator

Unified factory constructor for LatticeModel subtypes.

Dispatches on the argument types to construct the appropriate concrete representation. Frontend subtypes and Algorithm are not constructed via this factory.

source
QuantumLattices.Frameworks.OperatorGeneratorType
OperatorGenerator(bonds::Vector{<:Bond}, hilbert::Hilbert, terms::OneOrMore{Term}, boundary::Boundary=plain; half::Bool=false)

Construct a generator of quantum operators based on the input bonds, Hilbert space, terms and (twisted) boundary condition.

When the boundary condition is plain, the boundary operators will be set to be empty for simplicity and efficiency.

source
QuantumLattices.Frameworks.OperatorGeneratorType
OperatorGenerator{V<:Operators, CG<:CategorizedGenerator{V}, B<:Bond, H<:Hilbert, TS<:ZeroAtLeast{Term}} <: ParametricGenerator{V}

A generator of operators based on the terms, bonds and Hilbert space of a quantum lattice system.

source
QuantumLattices.Frameworks.StaticGeneratorType
StaticGenerator{M<:OperatorSet} <: Generator{M}

A LatticeModel that wraps a static OperatorSet.

Unlike ParametricGenerator, the operators have no parameter-update mechanism — they are treated as a fixed set.

source
Base.Filesystem.basenameMethod
basename(obj::Union{Assignment, Algorithm}; prefix::String="", suffix::String="", extension::String="qld") -> String

Get the basename of the data file of an assignment/algorithm.

source
Base.Filesystem.dirnameMethod
dirname(obj::Union{Assignment, Algorithm}) -> String

Get the dirname of the data file of an assignment/algorithm.

source
Base.eltypeMethod
eltype(model::LatticeModel)
eltype(::Type{T}) where {T<:LatticeModel}

Get the eltype of a LatticeModel.

source
Base.emptyMethod
empty(cat::CategorizedGenerator) -> CategorizedGenerator
empty!(cat::CategorizedGenerator) -> CategorizedGenerator

Get an empty copy of a categorized generator or empty a categorized generator of (representations of) quantum operators.

source
Base.emptyMethod
empty(gen::OperatorGenerator) -> OperatorGenerator
empty!(gen::OperatorGenerator) -> OperatorGenerator

Get an empty copy of or empty an operator generator.

source
Base.emptyMethod
empty(gen::StaticGenerator) -> StaticGenerator
empty!(gen::StaticGenerator) -> StaticGenerator

Get an empty copy of a static generator or empty it in place.

source
Base.isemptyMethod
isempty(gen::Generator) -> Bool

Judge whether a Generator is empty after lazy expansion.

source
Base.iterateMethod
iterate(gen::Generator)
iterate(::Generator, state)

Iterate over a Generator lazily.

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

Get the names of the boundary parameters.

source
Base.lengthMethod
length(gen::Generator) -> Int

Get the number of operators after lazy expansion.

source
Base.matchMethod
match(params₁::Parameters, params₂::Parameters; atol=atol, rtol=rtol) -> Bool

Judge whether the second set of parameters matches the first.

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.pathofMethod
pathof(obj::Union{Assignment, Algorithm}; prefix::String="", suffix::String="", extension::String="qld") -> String

Get the path of the data file of an assignment/algorithm.

source
Base.showMethod
show(io::IO, assign::Assignment)

Show an assignment.

source
Base.showMethod
show(io::IO, ::MIME"text/plain", alg::Algorithm)

Show an algorithm.

Optionally, some parameters of the algorithm can be filtered by specifying the :select context in io. Besides, the maximum number of decimals of the parameters can also be specified by the :ndecimal context in io.

source
Base.showMethod
show(io::IO, ::MIME"text/plain", assign::Assignment)

Show an assignment.

Optionally, some parameters of the algorithm can be filtered by specifying the :select context in io. Besides, the maximum number of decimals of the parameters can also be specified by the :ndecimal context in io.

source
Base.valtypeMethod
valtype(assign::Assignment)
valtype(::Type{<:Assignment})

Type of the data (result) of an assignment.

source
Base.valtypeMethod
valtype(model::LatticeModel)
valtype(::Type{<:LatticeModel})

Get the valtype of a LatticeModel. Subtypes must implement the type-level method.

source
QuantumLattices.Frameworks.fingerprintMethod
fingerprint(obj; ndecimal::Int=10) -> String

Generate a deterministic string fingerprint for an object, combining the string representation of id(obj) with that of Parameters(obj) (with numeric values rounded to ndecimal digits). When id(obj)/Parameters(obj) are not defined, the type name and an empty parameter list are used as fallbacks respectively.

source
QuantumLattices.Frameworks.optionsinfoMethod
optionsinfo(::Type{A}; level::Int=1) where {A<:Assignment} -> String

Get the complete info of the options of a certain type of Assignment, including that of its dependencies.

source
QuantumLattices.Frameworks.qldloadMethod
qldload(filename::String) -> Dict{String, Any}
qldload(filename::String, name::String) -> Any
qldload(filename::String, name₁::String, name₂::String, names::String...) -> Tuple

Load data from a qld file. With a single filename argument, returns all entries as a flat Dict. With a key, returns that single entry. With multiple keys, returns a Tuple.

source
QuantumLattices.Frameworks.qldsaveMethod
qldsave(obj::Union{Assignment, Algorithm}, objs::Union{Assignment, Algorithm}...; mode::String="a+", prefix::String="", suffix::String="", ndecimal::Int=10, select::Function=name::Symbol->true, front::String="", rear::String="")

Save a series of assignments/algorithms to qld files.

source
QuantumLattices.Spatials.dlmsaveFunction
dlmsave(assignment::Assignment, delim='	'; prefix::String="", suffix::String="", ndecimal::Int=10, select::Function=name::Symbol->true, front::String="", rear::String="")

Save the data of an assignment to a delimited file.

source
QuantumLattices.expand!Method
expand!(result, gen::Generator) -> typeof(result)

Expand the generator lazily and add the operators to result.

source
QuantumLattices.expandMethod
expand(gen::Generator) -> valtype(gen)
expand(gen::Generator, ::Eager) -> valtype(gen)
expand(gen::Generator, ::Lazy) -> valtype(gen)

Expand a Generator. Defaults to eager expansion which combines similar terms; pass lazy to preserve separate terms.

Subtypes must implement expand(gen, ::Lazy).

source
QuantumLattices.expandMethod
expand(gen::OperatorGenerator, name::Symbol) -> Operators
expand(gen::OperatorGenerator, i::Int) -> Operators
expand(gen::OperatorGenerator, name::Symbol, i::Int) -> Operators

Expand an operator generator to get:

  1. the operators of a specific term;
  2. the operators on a specific bond;
  3. the operators of a specific term on a specific bond.
source
QuantumLattices.reset!Method
reset!(bound::Boundary, values::AbstractVector{<:Number}) -> Boundary
reset!(bound::Boundary, vectors::AbstractVector{<:AbstractVector{<:Number}}) -> Boundary
reset!(bound::Boundary, values::AbstractVector{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}) -> Boundary

Reset the values or vectors of a twisted boundary condition in-place.

Note

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

source
QuantumLattices.reset!Method
reset!(cat::CategorizedGenerator, transformation::LinearTransformation, source::CategorizedGenerator; kwargs...)

Reset a categorized generator by its source categorized generator of (representations of) quantum operators and the corresponding linear transformation.

source
QuantumLattices.reset!Method
reset!(cat::CategorizedGenerator, transformation::LinearTransformation, source::OperatorGenerator; kwargs...)

Reset a categorized generator by its source operator generator of (representations of) quantum operators and the corresponding linear transformation.

source
QuantumLattices.reset!Method
reset!(gen::OperatorGenerator, bonds::AbstractVector{<:Bond}, hilbert::Hilbert; vectors::AbstractVector{<:AbstractVector}=gen.operators.boundary.vectors) -> OperatorGenerator

Reset an operator generator by a new lattice and the corresponding hilbert space.

source
QuantumLattices.reset!Method
reset!(gen::StaticGenerator, transformation::LinearTransformation, source::StaticGenerator; kwargs...) -> StaticGenerator

Reset a static generator from a source by applying the linear transformation to the source operators.

source
QuantumLattices.strMethod
str(params::Parameters; ndecimal::Int=10, select::Function=name::Symbol->true, front::String="", rear::String="") -> String

Convert a set of Parameters to a string with each number rounded to at most ndecimal decimal places. The select function can be used to filter which key-value pairs to include.

source
QuantumLattices.strMethod
str(obj::Union{Assignment, Algorithm}; prefix::String="", suffix::String="", ndecimal::Int=10, select::Function=name::Symbol->true, front::String="", rear::String="") -> String

Get the string representation of an assignment/algorithm.

source
QuantumLattices.update!Method
update!(alg::Algorithm; parameters...) -> Algorithm

Update the parameters of an algorithm and its associated frontend.

source
QuantumLattices.update!Method
update!(assign::Assignment; parameters...) -> Assignment

Update the parameters of an assignment and the status of its associated action.

source
QuantumLattices.update!Method
update!(cat::CategorizedGenerator, transformation::LinearTransformation, source::CategorizedGenerator; kwargs...) -> CategorizedGenerator

Update the parameters (including the boundary parameters) of a categorized generator based on its source categorized generator of (representations of) quantum operators and the corresponding linear transformation.

!!! Note The coefficients of boundops are also updated due to the change of the boundary parameters.

source
QuantumLattices.update!Method
update!(cat::CategorizedGenerator, transformation::LinearTransformation, source::OperatorGenerator; kwargs...) -> CategorizedGenerator

Update the parameters (including the boundary parameters) of a categorized generator based on its source operator generator of (representations of) quantum operators and the corresponding linear transformation.

!!! Note The coefficients of boundops are also updated due to the change of the boundary parameters.

source
QuantumLattices.update!Method
update!(cat::CategorizedGenerator{<:OperatorSum}; parameters...) -> CategorizedGenerator

Update the parameters (including the boundary parameters) of a categorized generator of (representations of) quantum operators.

!!! Note The coefficients of boundops are also updated due to the change of the boundary parameters.

source
QuantumLattices.update!Method
update!(formula::Formula; parameters...) -> Formula

Update the parameters of a Formula in place and return itself after update.

source
QuantumLattices.update!Method
update!(gen::OperatorGenerator; parameters...) -> typeof(gen)

Update the coefficients of the terms in a generator.

source
QuantumLattices.update!Method
update!(gen::StaticGenerator, transformation::LinearTransformation, source::StaticGenerator; kwargs...) -> StaticGenerator

Update the parameters of a static generator from a source. Since a static generator has no parameters, this is a no-op that returns the generator unchanged.

source
QuantumLattices.update!Method
update!(gen::StaticGenerator; parameters...) -> StaticGenerator

Update the parameters of a static generator. Since a static generator has no parameters, this is a no-op that returns the generator unchanged.

source
QuantumLattices.updateMethod
update(params::NamedTuple; parameters...) -> Parameters

Update a set of Parameters and return the updated one.

source