Frameworks
App and Engine
Assignment
Algorithm
Manual
QuantumLattices.Essentials.Frameworks.Algorithm
— TypeAlgorithm(name::String, engine::Engine;
din::String=".",
dout::String=".",
parameters::Union{Parameters, Nothing}=nothing,
map::Function=identity,
assignments::Tuple{Vararg{Assignment}}=(),
kwargs...
)
An algorithm associated with an engine.
QuantumLattices.Essentials.Frameworks.App
— TypeApp
Abstract type for all apps.
QuantumLattices.Essentials.Frameworks.Assignment
— TypeAssignment(id::Symbol, app::App, parameters::Parameters;
map::Function=identity,
dependences::Tuple{Vararg{Symbol}}=(),
data::Any=nothing,
savedata::Bool=true,
virgin::Bool=true,
kwargs...
)
An assignment associated with an app.
QuantumLattices.Essentials.Frameworks.Engine
— TypeEngine
Abstract type for all engines.
Base.:==
— Method==(assign1::Assignment, assign2::Assignment) -> Bool
Judge whether two assignments are equivalent to each other.
Base.get
— Methodget(alg::Algorithm, id::Symbol) -> Assignment
get(alg::Algorithm, ::Val{id}) where id -> Assignment
Find the assignment registered on a algorithm by its id.
Base.isequal
— Methodisequal(assign1::Assignment, assign2::Assignment) -> Bool
Judge whether two assignments are equivalent to each other.
Base.repr
— Functionrepr(alg::Algorithm, mask::Tuple{Vararg{Symbol}}=(); ndecimal::Int=10) -> String
Get the repr representation of an algorithm.
Optionally, some parameters of the algorithm can be masked. Besides, the maximum number of decimals of the parameters can also be specified.
Base.show
— Methodshow(io::IO, alg::Algorithm)
Show an algorithm.
Base.summary
— Methodsummary(alg::Algorithm)
Provide a summary of an algorithm.
Base.valtype
— Methodvaltype(assign::Assignment)
valtype(::Type{<:Assignment})
The type of the data(result) of an assignment.
QuantumLattices.Essentials.Frameworks.dependences
— Functiondependences(alg::Algorithm, assign::Assignment, ::Tuple{}=()) -> Tuple{Vararg{Symbol}}
dependences(alg::Algorithm, assign::Assignment, mask::Tuple{Vararg{Symbol}}) -> Tuple{Vararg{Symbol}}
Get the dependences of an assignment and return their ids.
QuantumLattices.Essentials.Frameworks.prepare!
— Methodprepare!(alg::Algorithm, assign::Assignment) -> Nothing
Prepare an assignment registered on a algorithm.
QuantumLattices.Essentials.Frameworks.register!
— Methodregister!(alg::Algorithm, id::Symbol, app::App; kwargs...) -> Algorithm
Add an assignment on a algorithm by providing the contents of the assignment, and run this assignment.
QuantumLattices.Essentials.Frameworks.run!
— Functionrun!(alg::Algorithm, id::Symbol, timing::Bool=true) -> Algorithm
run!(alg::Algorithm, ::Val{id}, timing::Bool=true) where id -> Algorithm
Run an assignment with the given id registered on an algorithm. Optionally, the run process can be timed by setting the timing
argument to be true
.
QuantumLattices.Essentials.Frameworks.run!
— Methodrun!(alg::Algorithm, assign::Assignment) -> Nothing
Run an assignment registered on a algorithm.
QuantumLattices.Essentials.Frameworks.rundependences!
— Functionrundependences!(alg::Algorithm, assign::Assignment, mask::Tuple{Vararg{Symbol}}=()) -> Algorithm
Run the dependences of an assignment. Optionally, some dependences can be jumped by specifying the mask
argument.
QuantumLattices.Essentials.update!
— Methodupdate!(alg::Algorithm; kwargs...) -> Algorithm
Update the parameters of an algorithm and its associated engine.
QuantumLattices.Essentials.update!
— Methodupdate!(app::App; kwargs...) -> App
Update the status of an app.
QuantumLattices.Essentials.update!
— Methodupdate!(assign::Assignment; kwargs...) -> Assignment
Update the parameters of an assignment and the status of its associated app.
QuantumLattices.Essentials.update!
— Methodupdate!(engine::Engine; kwargs...) -> Engine
Update the status of an engine.
QuantumLattices.Interfaces.add!
— Methodadd!(alg::Algorithm, id::Symbol, app::App; kwargs...) -> Algorithm
Add an assignment on a algorithm by providing the contents of the assignment.
The difference between add!
and register!
is that the add!
function does not run the newly added assignment but the register!
function does.
QuantumLattices.Interfaces.id
— Methodid(assign::Assignment) -> Symbol
id(::Type{<:Assignment}) -> Symbol
The id of an assignment.