Frameworks
QuantumLattices.Frameworks.eager
— Constantconst eager = Eager()
Singleton instance of Eager
.
QuantumLattices.Frameworks.lazy
— Constantconst lazy = Lazy()
Singleton instance of Lazy
.
QuantumLattices.Frameworks.Action
— TypeAction
Abstract type for all actions.
QuantumLattices.Frameworks.Algorithm
— TypeAlgorithm{F<:Frontend, P<:Parameters, M<:Function} <: Function
An algorithm associated with an frontend.
QuantumLattices.Frameworks.Algorithm
— Method(alg::Algorithm)(assign::Assignment) -> Tuple{Algorithm, Assignment}
(assign::Assignment)(alg::Algorithm) -> Tuple{Algorithm, 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
.
QuantumLattices.Frameworks.Algorithm
— Method(alg::Algorithm)(id::Symbol, action::Action; info::Bool=true, kwargs...) -> Tuple{Algorithm, Assignment}
Add an assignment on a algorithm by providing the contents of the assignment, and run this assignment.
QuantumLattices.Frameworks.Algorithm
— MethodAlgorithm(name::Symbol, frontend::Frontend; din::String=".", dout::String=".", parameters::Parameters=Parameters(frontend), map::Function=identity)
Construct an algorithm.
QuantumLattices.Frameworks.Algorithm
— Method(alg::Algorithm)(id::Symbol; info::Bool=true, parameters::Parameters=Parameters{()}()) -> Tuple{Algorithm, Assignment}
Run an assignment specified by its id.
Optionally, the time of the run process can be informed by setting the info
argument to be true
.
QuantumLattices.Frameworks.Assignment
— TypeAssignment{A<:Action, P<:Parameters, M<:Function, N, D} <: Function
An assignment associated with an action.
QuantumLattices.Frameworks.CategorizedGenerator
— TypeCategorizedGenerator{V, C, A<:NamedTuple, B<:NamedTuple, P<:Parameters, D<:Boundary, S<:ExpansionStyle} <: Generator{V}
Categorized 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.Eager
— TypeEager <: ExpansionStyle
Eager expansion style with eager computation so that similar terms are combined in the final result.
QuantumLattices.Frameworks.ExpansionStyle
— TypeExpansionStyle
Expansion style of a generator of (representations of) quantum operators. It has two singleton subtypes, Eager
and Lazy
.
QuantumLattices.Frameworks.Formula
— TypeFormula{V, F<:Function, P<:Parameters}
Representation of a quantum lattice system with an explicit analytical formula.
QuantumLattices.Frameworks.Frontend
— TypeFrontend
Frontend of algorithms applied to a quantum lattice system.
QuantumLattices.Frameworks.Generator
— TypeGenerator{V}
Generator of (representations of) quantum operators in a quantum lattice system.
QuantumLattices.Frameworks.Generator
— MethodGenerator(constops, alterops::NamedTuple, boundops::NamedTuple, parameters::Parameters, boundary::Boundary, style::ExpansionStyle) -> CategorizedGenerator
Construct a CategorizedGenerator
.
QuantumLattices.Frameworks.Generator
— MethodGenerator(operators::CategorizedGenerator{<:Operators}, terms::Tuple{Vararg{Term}}, bonds::Vector{<:Bond}, hilbert::Hilbert, half::Bool) -> OperatorGenerator
Generator(terms::Tuple{Vararg{Term}}, bonds::Vector{<:Bond}, hilbert::Hilbert, boundary::Boundary=plain, style::ExpansionStyle=eager; half::Bool=false) -> OperatorGenerator
Construct an OperatorGenerator
.
QuantumLattices.Frameworks.Lazy
— TypeLazy <: ExpansionStyle
Lazy expansion style with lazy computation so that similar terms are not combined in the final result.
QuantumLattices.Frameworks.OperatorGenerator
— TypeOperatorGenerator(terms::Tuple{Vararg{Term}}, bonds::Vector{<:Bond}, hilbert::Hilbert, boundary::Boundary=plain, style::ExpansionStyle=eager; half::Bool=false)
Construct a generator of (representations of) quantum operators based on the input terms, bonds, Hilbert space 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
— TypeOperatorGenerator{V<:Operators, CG<:CategorizedGenerator{V}, TS<:Tuple{Vararg{Term}}, B<:Bond, H<:Hilbert} <: Generator{V}
A generator of operators based on the terms, bonds and Hilbert space of a quantum lattice system.
QuantumLattices.Frameworks.Parameters
— TypeParameters{Names}(values::Number...) where Names
A NamedTuple that contains the key-value pairs.
QuantumLattices.Frameworks.Parameters
— MethodParameters(bound::Boundary)
Get the parameters of the twisted boundary condition.
QuantumLattices.Frameworks.Parameters
— MethodParameters(cat::CategorizedGenerator)
Get the complete set of parameters of a categorized generator of (representations of) quantum operators.
QuantumLattices.Frameworks.Parameters
— MethodParameters(ops::OperatorSet) -> NamedTuple{(), Tuple{}}
Get the parameters of an OperatorSet
, which is defined to be an empty NamedTuple
.
QuantumLattices.QuantumOperators.LinearTransformation
— Method(transformation::LinearTransformation)(cat::CategorizedGenerator; kwargs...) -> CategorizedGenerator
Apply a linear transformation to a categorized generator of (representations of) quantum operators.
QuantumLattices.QuantumOperators.Transformation
— Method(transformation::Transformation)(gen::OperatorGenerator; kwargs...) -> CategorizedGenerator
Get the transformation applied to a generator of (representations of) quantum operators.
Base.:*
— Method*(cat::CategorizedGenerator, factor) -> CategorizedGenerator
*(factor, cat::CategorizedGenerator) -> CategorizedGenerator
Multiply a categorized generator of (representations of) quantum operators with a factor.
Base.:+
— Method+(cat₁::CategorizedGenerator, cat₂::CategorizedGenerator) -> CategorizedGenerator
Addition of two categorized generators of (representations of) quantum operators.
Base.empty
— Methodempty(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.
Base.empty
— Methodempty(gen::OperatorGenerator) -> OperatorGenerator
empty!(gen::OperatorGenerator) -> OperatorGenerator
Get an empty copy of or empty an operator generator.
Base.isempty
— Methodisempty(cat::CategorizedGenerator) -> Bool
Judge whether a categorized generator is empty.
Base.match
— Methodmatch(params₁::Parameters, params₂::Parameters; atol=atol, rtol=rtol) -> Bool
Judge whether the second set of parameters matches the first.
Base.nameof
— Methodnameof(alg::Algorithm, assign::Assignment) -> String
Get the name of the combination of an algorithm and an assignment.
Base.show
— Methodshow(io::IO, 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.summary
— Methodsummary(alg::Algorithm)
Provide a summary of an algorithm.
Base.valtype
— Methodvaltype(assign::Assignment)
valtype(::Type{<:Assignment})
Type of the data (result) of an assignment.
QuantumLattices.Frameworks.prepare!
— Functionprepare!(alg::Algorithm, assign::Assignment, f::Function=assign->true) -> Tuple{Algorithm, Assignment}
Run the dependencies of an assignment.
Optionally, some dependencies can be filtered by specifying the f
function.
QuantumLattices.Spatials.save
— Methodsave(alg::Algorithm, assign::Assignment; delimited=false) -> Tuple{Algorithm, Assignment}
Save the data of an assignment registered on an algorithm.
QuantumLattices.add!
— Methodadd!(alg::Algorithm, id::Symbol, action::Action; parameters::Parameters=Parameters{()}(), map::Function=identity, dependencies::Tuple=(), kwargs...) -> Tuple{Algorithm, Assignment}
Add an assignment on an algorithm by providing the contents of the assignment without the execution of it.
QuantumLattices.expand!
— Methodexpand!(result, gen::Generator) -> typeof(result)
Expand the generator to add the (representations of) quantum operators in a quantum lattice system to result
.
QuantumLattices.expand
— Methodexpand(cat::CategorizedGenerator, ::Lazy)
Expand a categorized generator to get the (representations of) quantum operators in a quantum lattice system.
QuantumLattices.expand
— Methodexpand(gen::Generator)
expand(gen::Generator, ::Eager)
expand(gen::Generator, ::Lazy)
Expand the generator to get the (representations of) quantum operators in a quantum lattice system.
QuantumLattices.expand
— Methodexpand(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:
- the operators of a specific term;
- the operators on a specific bond;
- the operators of a specific term on a specific bond.
QuantumLattices.reset!
— Methodreset!(cat::CategorizedGenerator, transformation::LinearTransformation, source::CategorizedGenerator{<:Operators}; kwargs...)
Reset a categorized generator by its source categorized generator of (representations of) quantum operators and the corresponding linear transformation.
QuantumLattices.reset!
— Methodreset!(gen::OperatorGenerator, lattice::AbstractLattice, hilbert::Hilbert; neighbors=max(map(term->term.bondkind, gen.terms)...)) -> OperatorGenerator
Reset an operator generator by a new lattice and the corresponding new hilbert space.
QuantumLattices.update!
— Methodupdate!(alg::Algorithm; parameters...) -> Algorithm
Update the parameters of an algorithm and its associated frontend.
QuantumLattices.update!
— Methodupdate!(assign::Assignment; parameters...) -> Assignment
Update the parameters of an assignment and the status of its associated action.
QuantumLattices.update!
— Methodupdate!(cat::CategorizedGenerator, transformation::LinearTransformation, source::CategorizedGenerator{<:Operators}; 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.
QuantumLattices.update!
— Methodupdate!(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.
QuantumLattices.update!
— Methodupdate!(gen::OperatorGenerator; parameters...) -> typeof(gen)
Update the coefficients of the terms in a generator.
RecipesBase.apply_recipe
— Method@recipe plot(pack::Tuple{Algorithm, Assignment})
Define the recipe for the visualization of an assignment of an algorithm.