Frameworks
QuantumLattices.Frameworks.eager — Constant
const eager = Eager()Singleton instance of Eager.
QuantumLattices.Frameworks.lazy — Constant
const lazy = Lazy()Singleton instance of Lazy.
Core.Tuple — Method
Tuple(data::Data)Convert Data to Tuple.
QuantumLattices.Frameworks.Action — Type
ActionAbstract type for all actions.
QuantumLattices.Frameworks.Algorithm — Type
(alg::Algorithm)(assign::Assignment, checkoptions::Bool=true; options...) -> Assignment
(assign::Assignment)(alg::Algorithm, checkoptions::Bool=true; options...) -> AssignmentRun 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.
QuantumLattices.Frameworks.Algorithm — Type
Algorithm(name::Symbol, frontend::Frontend, parameters::Parameters=Parameters(frontend), map::Function=identity; dir::String=".", timer::TimerOutput=TimerOutput())Construct an algorithm.
QuantumLattices.Frameworks.Algorithm — Type
Algorithm{F<:Frontend, P<:Parameters, M<:Function} <: LatticeModelAn algorithm associated with a frontend.
QuantumLattices.Frameworks.Algorithm — Method
(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...) -> AssignmentAdd an assignment on an algorithm by providing the contents of the assignment, and run this assignment.
QuantumLattices.Frameworks.Assignment — Type
Assignment{A<:Action, P<:Parameters, M<:Function, N, D<:Data} <: FunctionAn assignment associated with an action.
QuantumLattices.Frameworks.Boundary — Type
Boundary{Names}(values::AbstractVector{<:Number}, vectors::AbstractVector{<:AbstractVector{<:Number}}) where NamesBoundary twist of operators.
QuantumLattices.Frameworks.Boundary — Method
(bound::Boundary)(operator::Operator; origin::Union{AbstractVector, Nothing}=nothing) -> OperatorGet the boundary twisted operator.
QuantumLattices.Frameworks.CategorizedGenerator — Type
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.
QuantumLattices.Frameworks.Data — Type
DataAbstract type for the data of an action.
QuantumLattices.Frameworks.Eager — Type
Eager <: ExpansionStyleEager expansion style with eager computation so that similar terms are combined in the final result.
QuantumLattices.Frameworks.ExpansionStyle — Type
ExpansionStyleExpansion style of a generator of (representations of) quantum operators. It has two singleton subtypes, Eager and Lazy.
QuantumLattices.Frameworks.Formula — Type
Formula{V, F<:Function, P<:Parameters}Representation of a quantum lattice system with an explicit analytical formula.
QuantumLattices.Frameworks.Formula — Method
(formula::Formula)(args...; kwargs...) -> valtype(formula)Get the result of a Formula.
QuantumLattices.Frameworks.Frontend — Type
Frontend <: LatticeModelFrontend of algorithms applied to a quantum lattice system.
QuantumLattices.Frameworks.Generator — Type
Generator{V} <: LatticeModelAbstract supertype for lattice models that are represented by generators of operators.
It has three branches: StaticGenerator, and ParametricGenerator (which includes CategorizedGenerator and OperatorGenerator).
Generator also serves as a constructor factory, dispatching to the appropriate concrete subtype based on the arguments.
QuantumLattices.Frameworks.Generator — Method
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) -> OperatorGeneratorFactory 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).
QuantumLattices.Frameworks.LatticeModel — Type
LatticeModelAbstract supertype for all representations of a quantum lattice system.
Subtypes must implement valtype. Parameters and update! should also be implemented as applicable.
QuantumLattices.Frameworks.LatticeModel — Method
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) -> OperatorGeneratorUnified 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.
QuantumLattices.Frameworks.Lazy — Type
Lazy <: ExpansionStyleLazy expansion style with lazy computation so that similar terms are not combined in the final result.
QuantumLattices.Frameworks.OperatorGenerator — Type
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.
QuantumLattices.Frameworks.OperatorGenerator — Type
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.
QuantumLattices.Frameworks.Parameters — Type
Parameters{Names}(values::Number...) where NamesA NamedTuple that contains the key-value pairs.
QuantumLattices.Frameworks.Parameters — Method
Parameters(algorithm::Algorithm)Get the parameters of an algorithm.
QuantumLattices.Frameworks.Parameters — Method
Parameters(assignment::Assignment) -> ParametersGet the parameters of an assignment.
QuantumLattices.Frameworks.Parameters — Method
Parameters(bound::Boundary)Get the parameters of the twisted boundary condition.
QuantumLattices.Frameworks.Parameters — Method
Parameters(cat::CategorizedGenerator)Get the complete set of parameters of a categorized generator of (representations of) quantum operators.
QuantumLattices.Frameworks.Parameters — Method
Parameters(formula::Formula) -> ParametersGet the parameters of a Formula.
QuantumLattices.Frameworks.Parameters — Method
Parameters(gen::OperatorGenerator) -> ParametersGet the parameters of an OperatorGenerator.
QuantumLattices.Frameworks.Parameters — Method
Parameters(gen::StaticGenerator) -> ParametersGet the parameters of a static generator, which are always empty.
QuantumLattices.Frameworks.ParametricGenerator — Type
ParametricGenerator{V} <: Generator{V}Abstract supertype for generators that carry parameters and support update!.
Its concrete subtypes are CategorizedGenerator and OperatorGenerator.
QuantumLattices.Frameworks.StaticGenerator — Type
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.
QuantumLattices.QuantumOperators.LinearTransformation — Method
(transformation::LinearTransformation)(cat::CategorizedGenerator; kwargs...) -> CategorizedGeneratorApply a linear transformation to a categorized generator of (representations of) quantum operators.
QuantumLattices.QuantumOperators.LinearTransformation — Method
(transformation::LinearTransformation)(gen::OperatorGenerator; kwargs...) -> CategorizedGeneratorGet the transformation applied to a generator of quantum operators.
QuantumLattices.QuantumOperators.LinearTransformation — Method
(transformation::LinearTransformation)(gen::StaticGenerator; kwargs...) -> StaticGeneratorApply a linear transformation to a static generator of (representations of) quantum operators.
Base.Filesystem.basename — Method
basename(obj::Union{Assignment, Algorithm}; prefix::String="", suffix::String="", extension::String="qld") -> StringGet the basename of the data file of an assignment/algorithm.
Base.Filesystem.dirname — Method
dirname(obj::Union{Assignment, Algorithm}) -> StringGet the dirname of the data file of an assignment/algorithm.
Base.eltype — Method
eltype(model::LatticeModel)
eltype(::Type{T}) where {T<:LatticeModel}Get the eltype of a LatticeModel.
Base.empty — Method
empty(cat::CategorizedGenerator) -> CategorizedGenerator
empty!(cat::CategorizedGenerator) -> CategorizedGeneratorGet an empty copy of a categorized generator or empty a categorized generator of (representations of) quantum operators.
Base.empty — Method
empty(gen::OperatorGenerator) -> OperatorGenerator
empty!(gen::OperatorGenerator) -> OperatorGeneratorGet an empty copy of or empty an operator generator.
Base.empty — Method
empty(gen::StaticGenerator) -> StaticGenerator
empty!(gen::StaticGenerator) -> StaticGeneratorGet an empty copy of a static generator or empty it in place.
Base.isempty — Method
isempty(gen::Generator) -> BoolJudge whether a Generator is empty after lazy expansion.
Base.iterate — Method
iterate(gen::Generator)
iterate(::Generator, state)Iterate over a Generator lazily.
Base.length — Method
length(gen::Generator) -> IntGet the number of operators after lazy expansion.
Base.match — Method
match(params₁::Parameters, params₂::Parameters; atol=atol, rtol=rtol) -> BoolJudge whether the second set of parameters matches the first.
Base.merge! — Method
merge!(bound::Boundary, another::Boundary) -> typeof(bound)Merge the values and vectors of the twisted boundary condition from another one.
Base.pathof — Method
pathof(obj::Union{Assignment, Algorithm}; prefix::String="", suffix::String="", extension::String="qld") -> StringGet the path of the data file of an assignment/algorithm.
Base.show — Method
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.
Base.show — Method
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.
Base.summary — Method
summary(alg::Algorithm)Provide a summary of an algorithm.
Base.valtype — Method
valtype(assign::Assignment)
valtype(::Type{<:Assignment})Type of the data (result) of an assignment.
Base.valtype — Method
valtype(model::LatticeModel)
valtype(::Type{<:LatticeModel})Get the valtype of a LatticeModel. Subtypes must implement the type-level method.
QuantumLattices.Frameworks.checkoptions — Method
checkoptions(::Type{A}; options...) where {A<:Assignment}Check whether the keyword arguments are legal options of a certain type of Assignment.
QuantumLattices.Frameworks.datatype — Method
datatype(::Type{A}, ::Type{F}) where {A<:Action, F<:Frontend}Get the concrete subtype of Data according to the types of an Action and a Frontend.
QuantumLattices.Frameworks.fingerprint — Method
fingerprint(obj; ndecimal::Int=10) -> StringGenerate 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.
QuantumLattices.Frameworks.hasoption — Method
hasoption(::Type{A}, option::Symbol) where {A<:Assignment} -> BoolJudge whether a certain type of Assignment has an option.
QuantumLattices.Frameworks.options — Method
options(::Type{<:Assignment}) -> NamedTupleGet the options of a certain type of Assignment.
QuantumLattices.Frameworks.optionsinfo — Method
optionsinfo(::Type{A}; level::Int=1) where {A<:Assignment} -> StringGet the complete info of the options of a certain type of Assignment, including that of its dependencies.
QuantumLattices.Frameworks.plain — Function
plainPlain boundary condition without any twist.
QuantumLattices.Frameworks.qldload — Method
qldload(filename::String) -> Dict{String, Any}
qldload(filename::String, name::String) -> Any
qldload(filename::String, name₁::String, name₂::String, names::String...) -> TupleLoad 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.
QuantumLattices.Frameworks.qldsave — Method
qldsave(filename::String, args...; mode::String="a+")Save arbitrary data as key-value pairs to a qld file.
QuantumLattices.Frameworks.qldsave — Method
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.
QuantumLattices.Frameworks.run! — Function
run!(alg::Algorithm, assign::Assignment; options...)Run an assignment based on an algorithm.
QuantumLattices.Frameworks.seriestype — Method
seriestype(data::Data) -> Union{Symbol, Nothing}Determine the plot seriestype for data. Returns :path, :heatmap, or nothing.
QuantumLattices.QuantumOperators.scalartype — Method
scalartype(model::LatticeModel)
scalartype(::Type{T}) where {T<:LatticeModel}Get the scalar type of a LatticeModel.
QuantumLattices.Spatials.dlmsave — Function
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.
QuantumLattices.expand! — Method
expand!(result, gen::Generator) -> typeof(result)Expand the generator lazily and add the operators to result.
QuantumLattices.expand — Method
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).
QuantumLattices.expand — Method
expand(gen::OperatorGenerator, name::Symbol) -> Operators
expand(gen::OperatorGenerator, i::Int) -> Operators
expand(gen::OperatorGenerator, name::Symbol, i::Int) -> OperatorsExpand an operator generator to get:
- the operators of a specific term;
- the operators on a specific bond;
- the operators of a specific term on a specific bond.
QuantumLattices.id — Method
id(obj::Union{Assignment, Algorithm})Get the identifier of an assignment/algorithm.
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}}) -> BoundaryReset the values or vectors of a twisted boundary condition in-place.
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.
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.
QuantumLattices.reset! — Method
reset!(gen::OperatorGenerator, bonds::AbstractVector{<:Bond}, hilbert::Hilbert; vectors::AbstractVector{<:AbstractVector}=gen.operators.boundary.vectors) -> OperatorGeneratorReset an operator generator by a new lattice and the corresponding hilbert space.
QuantumLattices.reset! — Method
reset!(gen::StaticGenerator, transformation::LinearTransformation, source::StaticGenerator; kwargs...) -> StaticGeneratorReset a static generator from a source by applying the linear transformation to the source operators.
QuantumLattices.str — Method
str(params::Parameters; ndecimal::Int=10, select::Function=name::Symbol->true, front::String="", rear::String="") -> StringConvert 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.
QuantumLattices.str — Method
str(obj::Union{Assignment, Algorithm}; prefix::String="", suffix::String="", ndecimal::Int=10, select::Function=name::Symbol->true, front::String="", rear::String="") -> StringGet the string representation of an assignment/algorithm.
QuantumLattices.update! — Method
update!(action::Action; parameters...) -> ActionUpdate the parameters of an action.
QuantumLattices.update! — Method
update!(alg::Algorithm; parameters...) -> AlgorithmUpdate the parameters of an algorithm and its associated frontend.
QuantumLattices.update! — Method
update!(assign::Assignment; parameters...) -> AssignmentUpdate the parameters of an assignment and the status of its associated action.
QuantumLattices.update! — Method
update!(bound::Boundary; parameters...) -> BoundaryUpdate the values of the boundary twisted phase.
QuantumLattices.update! — Method
update!(cat::CategorizedGenerator, transformation::LinearTransformation, source::CategorizedGenerator; kwargs...) -> CategorizedGeneratorUpdate 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.
QuantumLattices.update! — Method
update!(cat::CategorizedGenerator, transformation::LinearTransformation, source::OperatorGenerator; kwargs...) -> CategorizedGeneratorUpdate 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.
QuantumLattices.update! — Method
update!(cat::CategorizedGenerator{<:OperatorSum}; parameters...) -> CategorizedGeneratorUpdate 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.
QuantumLattices.update! — Method
update!(formula::Formula; parameters...) -> FormulaUpdate the parameters of a Formula in place and return itself after update.
QuantumLattices.update! — Method
update!(gen::OperatorGenerator; parameters...) -> typeof(gen)Update the coefficients of the terms in a generator.
QuantumLattices.update! — Method
update!(gen::StaticGenerator, transformation::LinearTransformation, source::StaticGenerator; kwargs...) -> StaticGeneratorUpdate 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.
QuantumLattices.update! — Method
update!(gen::StaticGenerator; parameters...) -> StaticGeneratorUpdate the parameters of a static generator. Since a static generator has no parameters, this is a no-op that returns the generator unchanged.
QuantumLattices.update — Method
update(params::NamedTuple; parameters...) -> ParametersUpdate a set of Parameters and return the updated one.