API
Hilbert Spaces
QuantumCumulants.HilbertSpace
— TypeHilbertSpace
Abstract type for representing Hilbert spaces.
QuantumCumulants.ProductSpace
— TypeProductSpace <: HilbertSpace
Stores a composite HilbertSpace
consisting of multiple subspaces. Generally created by computing the tensor product ⊗
of subspaces.
QuantumCumulants.FockSpace
— TypeFockSpace <: HilbertSpace
HilbertSpace
defining a Fock space for bosonic operators. See also: Destroy
, Create
QuantumCumulants.NLevelSpace
— TypeNLevelSpace <: HilbertSpace
NLevelSpace(name::Symbol,levels,GS=levels[1])
Define a HilbertSpace
for an object consisting of N
discrete energy levels. The given levels
must be an integer specifying the number of levels, or an iterable collection of levels. The argument GS
specifies which state should be treated as ground state and is rewritten using population conservation during simplification. See also: Transition
Examples:
julia> ha = NLevelSpace(:a,3)
ℋ(a)
julia> ha = NLevelSpace(:a,(:g,:e))
ℋ(a)
QuantumCumulants.ClusterSpace
— TypeClusterSpace <: HilbertSpace
ClusterSpace(original_space,N,order)
A Hilbert space representing N
identical copies of another Hilbert space, with correlations up to a specified order
.
QuantumInterface.:⊗
— Function⊗(spaces::HilbertSpace...)
Create a ProductSpace
consisting of multiple subspaces. Unicode \otimes<tab>
alias of tensor
Examples
julia> hf = FockSpace(:f)
ℋ(f)
julia> ha = NLevelSpace(:a,2)
ℋ(a)
julia> h = hf⊗ha
ℋ(f) ⊗ ℋ(a)
QuantumInterface.tensor
— Functiontensor(spaces::HilbertSpace...)
Create a ProductSpace
consisting of multiple subspaces. See also ⊗
.
QuantumCumulants.PauliSpace
— TypePauliSpace <: HilbertSpace
HilbertSpace
defining a Spin space for two-level atom Pauli operators. See also: Pauli
, Create
QuantumCumulants.Pauli
— TypePauli <: QSym
Pauli operator on a PauliSpace
representing the Pauli operators σx, σy and σz for two-level spin systems. The field axis represents x, y and z as 1, 2 and 3, repectively. The used rewriting rule is σj⋅σk → δjk + i⋅ϵjkl⋅σl.
Examples
julia> h = PauliSpace("Spin-1/2")
ℋ(Spin-1/2)
julia> σx = Pauli(h,:σ,1)
σx
QuantumCumulants.SpinSpace
— TypeSpinSpace <: HilbertSpace
HilbertSpace
defining a Spin space for N > 1 identical two-level atom operators. See also: Spin
, Create
QuantumCumulants.Spin
— TypeSpin <: QSym
Spin operator on a SpinSpace
representing the Spin-operators Sx, Sy and Sz for collective spin systems. The field axis represents x, y and z as 1, 2 and 3, repectively. The operators follow the rules for angular momentum operators: [Sj,Sk] = i⋅∑ϵjkl⋅Sl
Examples
julia> h = SpinSpace("Spin-N/2")
ℋ(Spin-N/2)
julia> Sx = Spin(h,:S,1)
Sx
q-Numbers
QuantumCumulants.QSym
— TypeQSym <: QNumber
Abstract type representing fundamental operator types.
QuantumCumulants.QTerm
— TypeQTerm <: QNumber
Abstract type representing noncommutative expressions.
QuantumCumulants.@qnumbers
— Macro@qnumbers
Convenience macro for the construction of operators.
Examples
julia> h = FockSpace(:fock)
ℋ(fock)
julia> @qnumbers a::Destroy(h)
(a,)
julia> h = FockSpace(:one) ⊗ FockSpace(:two)
ℋ(one) ⊗ ℋ(two)
julia> @qnumbers b::Destroy(h,2)
(b,)
QuantumCumulants.Destroy
— TypeDestroy <: QSym
Bosonic operator on a FockSpace
representing the quantum harmonic oscillator annihilation operator.
QuantumCumulants.Create
— TypeCreate <: QSym
Bosonic operator on a FockSpace
representing the quantum harmonic oscillator creation operator.
QuantumCumulants.Transition
— TypeTransition <: QSym
Transition(h::NLevelSpace,name::Symbol,i,j)
Fundamental operator defining a transition from level j
to level i
on a NLevelSpace
. The notation corresponds to Dirac notation, i.e. the above is equivalent to |i⟩⟨j|
.
Examples
julia> ha = NLevelSpace(:a,(:g,:e))
ℋ(a)
julia> σ = Transition(ha,:σ,:g,:e)
σge
Mean field
QuantumCumulants.meanfield
— Functionmeanfield(ops::Vector,H::QNumber)
meanfield(op::QNumber,H::QNumber)
meanfield(ops::Vector,H::QNumber,J::Vector;
Jdagger::Vector=adjoint.(J),rates=ones(length(J)))
meanfield(op::QNumber,H::QNumber,J::Vector;
Jdagger::Vector=adjoint.(J),rates=ones(length(J)))
Compute the set of equations for the operators in ops
under the Hamiltonian H
and with loss operators contained in J
. The resulting equation is equivalent to the Quantum-Langevin equation where noise is neglected.
Arguments
*ops::Vector
: The operators of which the equations are to be computed. *H::QNumber
: The Hamiltonian describing the reversible dynamics of the system. *J::Vector{<:QNumber}
: A vector containing the collapse operators of the system. A term of the form $\sum_i J_i^\dagger O J_i - \frac{1}{2}\left(J_i^\dagger J_i O + OJ_i^\dagger J_i\right)$ is added to the Heisenberg equation.
Optional argumentes
*Jdagger::Vector=adjoint.(J)
: Vector containing the hermitian conjugates of the collapse operators. *rates=ones(length(J))
: Decay rates corresponding to the collapse operators in J
. *multithread=false
: Specify whether the derivation of equations for all operators in ops
should be multithreaded using Threads.@threads
. *simplify=true
: Specify whether the derived equations should be simplified. *order=nothing
: Specify to which order
a cumulant_expansion
is performed. If nothing
, this step is skipped. *mix_choice=maximum
: If the provided order
is a Vector
, mix_choice
determines which order
to prefer on terms that act on multiple Hilbert spaces. *iv=ModelingToolkit.t
: The independent variable (time parameter) of the system.
QuantumCumulants.commutator
— Functioncommutator(a,b)
Computes the commutator a*b - b*a
.
QuantumCumulants.acts_on
— Functionacts_on(op)
Shows on which Hilbert space op
acts. For QSym
types, this returns an Integer, whereas for a Term
it returns a Vector{Int}
whose entries specify all subspaces on which the expression acts.
QuantumCumulants.MeanfieldEquations
— TypeMeanfieldEquations <: AbstractMeanfieldEquations
Type defining a system of differential equations, where lhs
is a vector of derivatives and rhs
is a vector of expressions. In addition, it keeps track of the Hamiltonian, the collapse operators and the corresponding decay rates of the system.
Fields
*equations
: Vector of the differential equations of averages. *operator_equations
: Vector of the operator differential equations. *states
: Vector containing the averages on the left-hand-side of the equations. *operators
: Vector containing the operators on the left-hand-side of the equations. *hamiltonian
: Operator defining the system Hamiltonian. *jumps
: Vector of operators specifying the decay processes. *jumps
: Vector of operators specifying the adjoint of the decay processes. *rates
: Decay rates corresponding to the jumps
. *iv
: The independent variable (time parameter) of the system. *varmap
: Vector of pairs that map the averages to time-dependent variables. That format is necessary for ModelingToolkit functionality. *order
: The order at which the cumulant_expansion
has been performed.
Symbolic Numbers
QuantumCumulants.CNumber
— TypeQuantumCumulants.Parameter
— TypeParameter <: CNumber
Type used as symbolic type in a SymbolicUtils.Sym
variable to represent a parameter.
QuantumCumulants.cnumbers
— Functioncnumbers(symbols::Symbol...)
cnumbers(s::String)
Create symbolic cnumbers.
Expamples
julia> ps = cnumbers(:a, :b)
(a, b)
julia> cnumbers("a b") == ps
true
QuantumCumulants.cnumber
— Functioncnumber(symbols::Symbol)
cnumber(s::String)
Create symbolic cnumber.
Expamples
julia> ps = cnumber(:a)
a
julia> cnumber("a") == ps
true
QuantumCumulants.@cnumbers
— Macro@cnumbers(ps...)
Convenience macro to quickly define symbolic cnumbers.
Examples
julia> @cnumbers ω κ
(ω, κ)
QuantumCumulants.RNumber
— TypeRNumber <: Real
Abstract type for real symbolic numbers RealParameter
.
QuantumCumulants.RealParameter
— TypeRealParameter <: RNumber
Type used as symbolic type in a SymbolicUtils.Sym
variable to represent a real parameter.
QuantumCumulants.rnumbers
— Functionrnumbers(symbols::Symbol...)
rnumbers(s::String)
Create symbolic rnumbers.
Expamples
julia> ps = rnumbers(:a, :b)
(a, b)
julia> rnumbers("a b") == ps
true
QuantumCumulants.rnumber
— Functionrnumber(symbols::Symbol)
rnumber(s::String)
Create symbolic rnumber.
Expamples
julia> ps = rnumber(:a)
a
julia> rnumber("a") == ps
true
QuantumCumulants.@rnumbers
— Macro@rnumbers(ps...)
Convenience macro to quickly define symbolic rnumbers.
Examples
julia> @rnumbers ω κ
(ω, κ)
Average
QuantumCumulants.average
— Functionaverage(::QNumber)
average(::QNumber,order)
Compute the average of an operator. If order
is given, the cumulant_expansion
up to that order is computed immediately.
QuantumCumulants.cumulant_expansion
— Functioncumulant_expansion(avg, order::Int)
For an average
of an operator, expand it in terms of moments up to order
neglecting their joint cumulant.
See also: https://en.wikipedia.org/wiki/Cumulant#Joint_cumulants
Examples
julia> avg = average(a*b)
⟨a*b⟩
julia> cumulant_expansion(avg,1)
(⟨a⟩*⟨b⟩)
julia> avg = average(a*b*c)
⟨a*b*c⟩
julia> cumulant_expansion(avg,2)
((⟨a*b⟩*⟨c⟩)+(⟨a*c⟩*⟨b⟩)+(⟨a⟩*⟨b*c⟩)+(-2*⟨a⟩*⟨b⟩*⟨c⟩))
Optional arguments
*simplify=true: Specify whether the result should be simplified. *kwargs...: Further keyword arguments being passed to simplification.
QuantumCumulants.cumulant
— Functioncumulant(x,n=get_order(x);simplify=true,kwargs...)
Compute the n
th cumulant of x
(either an operator or an average). The output is simplified when simplify=true
. Further keyword arguments are passed on to simplification.
Examples
julia> cumulant(a)
⟨a⟩
julia> cumulant(a*b)
(⟨a*b⟩+(-1*⟨a⟩*⟨b⟩))
julia> cumulant(a*b,1)
⟨a*b⟩
julia> cumulant(a*b,3)
0
QuantumCumulants.get_order
— Functionget_order(arg)
Compute the order of a given argument. This is the order used to decide whether something should be expanded using a cumulant_expansion
method.
Examples
julia> get_order(a)
1
julia> get_order(a*b)
2
julia> get_order(1)
0
Correlation functions
QuantumCumulants.CorrelationFunction
— Typestruct CorrelationFunction
Type representing the two-time first-order correlation function of two operators.
QuantumCumulants.Spectrum
— Typestruct Spectrum
Type representing the spectrum, i.e. the Fourier transform of a CorrelationFunction
in steady state.
To actually compute the spectrum at a frequency ω
, construct the type on top of a correlation function and call it with Spectrum(c)(ω,usteady,p0)
.
QuantumCumulants.correlation_u0
— Functioncorrelation_u0(c::CorrelationFunction, u_end)
Find the vector containing the correct initial values when numerical solving the time evolution for the correlation function.
See also: CorrelationFunction
correlation_p0
QuantumCumulants.correlation_p0
— Functioncorrelation_p0(c::CorrelationFunction, u_end, ps=Pair[])
Find all occurring steady-state values and add them to a list of parameters to pass this to the ODEProblem
.
See also: CorrelationFunction
correlation_u0
Utility functions
QuantumCumulants.find_missing
— Functionfind_missing(me::MeanfieldEquations, vs_adj=nothing, get_adjoints=true)
Find all averages on the right-hand-side of in me.equations
that are not listed me.states
. For a complete system this list is empty.
Optional arguments
*vs_adj
: List of the complex conjugates of me.states
. If set to nothing
the list is generated internally. *get_adjoints=true
: Specify whether a complex conjugate of an average should be explicitly listed as missing.
QuantumCumulants.find_operators
— Functionfind_operators(::HilbertSpace, order; names=nothing)
Find all operators that fully define a system up to the given order
.
ModelingToolkit.complete
— Functioncomplete(de::MeanfieldEquations)
From a set of differential equation of averages, find all averages that are missing and derive the corresponding equations of motion. Uses find_missing
and meanfield
to do so.
Optional arguments
*order=de.order
: The order at which the cumulant_expansion
is performed on the newly derived equations. If nothing
, the order is inferred from the existing equations. *filter_func=nothing
: Custom function that specifies whether some averages should be ignored when completing a system. This works by calling filter!(filter_func, missed)
where missed
is the vector resulting from find_missing
. Occurrences of averages for which filter_func
returns false
are substituted to 0. *extra_indices=Vector
: Used for indexed equations. Can be used to specify additional indices, that are needed for calculation. *kwargs...
: Further keyword arguments are passed on to meanfield
and simplification.
see also: find_missing
, meanfield
ModelingToolkit.complete!
— Functioncomplete!(de::MeanfieldEquations)
In-place version of complete
QuantumCumulants.unique_ops
— Functionunique_ops(ops)
For a given list of operators, return only unique ones taking into account their adjoints.
QuantumCumulants.unique_ops!
— Functionunique_ops!(ops)
In-place version of unique_ops
.
QuantumCumulants.fundamental_operators
— Functionfundamental_operators(::HilbertSpace)
Return all fundamental operators for a given Hilbertspace. For example, a FockSpace
only has one fundamental operator, Destroy
.
QuantumCumulants.transition_superscript
— Functiontransition_superscript(::Bool)
Specify whether the indices in a Transition
operator should be printed as superscript. Default is true
. If set to false
, the indices corresponding to the levels are printed as subscript.
QuantumCumulants.to_numeric
— Functionto_numeric(q::QNumber, b::QuantumOpticsBase.Basis; level_map = nothing)
to_numeric(q::QNumber, state; level_map = nothing)
Convert a symbolic operator q
to its equivalent numeric (matrix) form on the basis b
. The optional argument level_map
can be set to a dictionary that specifies how to map levels of a Transition
to the ones given in an NLevelBasis
. Note: If the levels of a transition are symbolic, setting level_map
is required.
See also: numeric_average
, initial_values
Examples
julia> to_numeric(Destroy(FockSpace(:fock), :a), FockBasis(10)) Operator(dim=11x11) basis: Fock(cutoff=10)[...]
QuantumCumulants.numeric_average
— Functionnumeric_average(avg::Average, state; level_map = nothing)
numeric_average(q::QNumber, state; level_map = nothing)
From a symbolic average avg
or operator q
, compute the corresponding numerical average value with the given quantum state state
. This state can either be of type QuantumOpticsBase.StateVector
or QuantumOpticsBase.Operator
.
See also: initial_values
, to_numeric
QuantumCumulants.initial_values
— Functioninitial_values(eqs::MeanfieldEquations, state; level_map=nothing)
For a set of symbolic equations eqs
compute the initial state average values corresponding to the numeric quantum state state
of the system. The quantum state can either be of type QuantumOpticsBase.StateVector
or QuantumOpticsBase.Operator
.
See also: to_numeric
, numeric_average
QuantumCumulants.get_solution
— Functionget_solution(sol, op::QTerm)
get_solution(sol, op::QNumber)
Returns the result for the average of the operator expression op
in the solution sol
of an ODE- or SteadyStateProblem, similar to sol[op]
. It can also be used for linear combinations of operators, which is not possible with sol[op]
.
Symbolic Summations
QuantumCumulants.Index
— TypeIndex(hilb::HilbertSpace,name::Symbol,range::Union{Int64,Sym},aon::Int)
Defines an index, using a Symbol as a name, and a HilbertSpace
for computation and commutator-relations. Indices with all same fields will be considered equal. See also: IndexedOperator
and IndexedVariable
Fields:
- hilb: The whole
HilbertSpace
, the index will be defined on. - name: A Symbol, which defines the name of the index, and how product-terms of
IndexedOperator
are ordered (alphabetical) - range: The upper bound limit of the index. This can be a SymbolicUitls.Symbolic or any Number.
- aon: Number specifying the specific
HilbertSpace
, where the Index acts on.
QuantumCumulants.IndexedOperator
— TypeIndexedOperator <: QSym
IndexedOperator(op::Union{Transition,Create,Destroy},ind::Index)
Operator, associated with an index.
Fields:
- op: Operator, either a
Transition
, aDestroy
or aCreate
can be defined. - ind: The index, the operator will be associated with.
QuantumCumulants.IndexedVariable
— TypeIndexedVariable <: CNumber
IndexedVariable(name::Symbol,ind::Index)
IndexedVariable(name::Symbol,ind1::Index,ind2:Index)
A indexed symbolic variable. The variable can (once equations are calculated) be easily exchanged for numerical values. Calling a IndexedVariable using two different Index
objects one can create DoubleIndexedVariable
objects. See also: value_map
QuantumCumulants.DoubleIndexedVariable
— TypeDoubleIndexedVariable <: CNumber
DoubleIndexedVariable(name::Symbol,ind1::Index,ind2::Index;identical::Bool)
A double-indexed symbolic variable. The variable can (once equations are calculated) be easily exchanged for numerical values. See also: value_map
Fields:
- name: A Symbol, defining the name of the variable
- ind1: The first Index of the variable
- ind2: The second Index of the variable
- identical: A Bool, defining if the variable can have non-zero main-diagonal terms, e.g: Γᵢᵢ ≠ 0 would be specified with true.
QuantumCumulants.SingleSum
— TypeSingleSum <: QTerm
Defines a symbolic summation over a term, using one Index
entity.
Fields:
- term: A multiplication of q-number terms. When the multiplication contains any
IndexedOperator
with the same index as the summation-index, a symbolic sum will be created. - sum_index: The index, for which the summation will go over.
- nonequalindices: (optional) A vector of indices, for which the summation-index can not be equal with.
QuantumCumulants.DoubleSum
— TypeDoubleSum <: QTerm
Defines a symbolic summation over another SingleSum
, using one Index
entity. This corresponds to a double-summation over a multiplication of terms.
Fields:
- innerSum: A
SingleSum
entity. - sum_index: The index, for which the (outer) summation will go over.
- NEI: (optional) A vector of indices, for which the (outer) summation-index can not be equal with.
QuantumCumulants.change_index
— Functionchange_index(term,from::Index,to::Index)
Exchanges all occuring indices inside the given term, that are equal to the from
to the to
index.
Examples
change_index(σⱼ²¹,j,i) = σᵢ²¹
change_index(σⱼ²¹ * σᵢ¹²,j,i) = σᵢ²²
QuantumCumulants.insert_index
— Functioninsert_index(term,ind::Index,value::Int)
Function, that inserts an integer value for a index in a specified term. This function creates Numbered- Variables/Operators/Sums upon calls.
Examples
insert_index(σⱼ²¹,j,1) = σ₁²¹
QuantumCumulants.SpecialIndexedTerm
— TypeSpecialIndexedTerm <: QTerm
A multiplication of IndexedOperator
entities, with special constraint on the index-values. For example σᵢ²² * σⱼ²² with the constraint i ≠ j
Fields:
- term: A multiplication of q-number terms.
- indexMapping: A Vector of
Index
tuples, specifying the contraints for the term. Each Tuple is considered to one constraint. e.g: (i,j) -> i ≠ j
QuantumCumulants.reorder
— Functionreorder(param,indexMapping)
Reorders a given term (param) regarding to a given indexMapping, which specifies, which Index
entities can not be equal inside the given term. reorder() creates a SpecialIndexedTerm
as a result.
Examples
reorder(σⱼ²¹ * σᵢ²¹,[(i,j)]) = σᵢ²¹ * σⱼ²¹
reorder(σⱼ²¹ * σᵢ²¹ * σⱼ¹²,[(i,j)]) = σᵢ²¹ * σⱼ²²
QuantumCumulants.IndexedAverageSum
— TypeIndexedAverageSum <: CNumber
Defines a symbolic summation over an average, or a multiplication of several averages, using one Index
entity.
Fields:
- term: A multiplication of average terms.
- sum_index: The index, for which the summation will go over.
- nonequalindices: (optional) A vector of indices, for which the summation-index can not be equal with.
QuantumCumulants.IndexedAverageDoubleSum
— TypeIndexedAverageDoubleSum <: CNumber
Defines a symbolic summation over an IndexedAverageSum
, using a Index
entity. This schematically represent a double-sum over a multiplication of averages.
Fields:
- innerSum: An
IndexedAverageSum
entity. - sum_index: The index, for which the (outer) summation will go over.
- nonequalindices: (optional) A vector of indices, for which the (outer) summation-index can not be equal with.
QuantumCumulants.NumberedOperator
— TypeNumberedOperator <: QSym
Defines an operator, associated with a Number. Commutator-relations are calculated using these numbers, as a sort of a specific index-value.
Fields:
- op: An Operator, either a
Transition
, aDestroy
or aCreate
can be defined. - numb: An Integer Number.
QuantumCumulants.evaluate
— Functionevaluate(eqs::IndexedMeanfieldEquations;limits)
evaluate(corr::CorrelationFunction;limits)
evaluate(x;limits)
Function, that evaluates a given MeanfieldEquations
entity and returns again equations, where indices have been inserted and sums evaluated. Can also be called on individual terms and a CorrelationFunction
entity, to evaluate any summations inside these terms.
Arguments
*me::MeanfieldEquations
: A MeanfieldEquations
entity, which shall be evaluated.
Optional argumentes
*limits::Dict{BasicSymbolic,Int64}=Dict{Symbol,Int64}()
: A seperate dictionary, to specify any symbolic limits used when Index
entities were defined. This needs to be specified, when the equations contain summations, for which the upper bound is given by a Symbolic. *h
: A HilbertSpace, Vector of Hilbertspaces or Numbers, specifying the specific Hilbertspaces, that shall be evaluated. Does not evaluate any other Hilbertspace, other than the given ones.
QuantumCumulants.scale
— Functionscale(me::IndexedMeanfieldEquations;h)
scale(me::CorrelationFunction;h)
Function, that evaluates a given MeanfieldEquations
or CorrelationFunction
entity and returns again equations, where indices have been inserted and sums evaluated, regarding the same relations, as done when calculating with oparators using a ClusterSpace
. For this it is considered that all entities in the given (sub)system are acting on the system equivalently.
Arguments
*me::IndexedMeanfieldEquations
: A MeanfieldEquations
entity, which shall be scaled.
Optional argumentes
*h
: A HilbertSpace, Vector of Hilbertspaces or Numbers, specifying the specific Hilbertspaces, that shall be scaled. Does not scale any other Hilbertspace, other than the given ones.
QuantumCumulants.value_map
— Functionvalue_map(ps::Vector,p0::Vector)
A Function to create parameter values for indexed Variables more convenient.
Arguments
*ps::Vector
: A vector of parameters, that have no value assigned to them. *p0::Vector
: A vector for numeric values, that should get assigned to the corresponding entry in the ps
vector. For Single-Indexed Variables the entry in the vector can also be again a Vector, that has an amount of entries as the index of the variables has range. For Double-Indexed Variables, this can also be a Matrix of a dimension, that corresponds to the ranges of the indices of the given variable.
QuantumCumulants.indexed_complete
— Functionindexed_complete(de::IndexedMeanfieldNoiseEquations)
From a set of differential equation of averages, find all averages that are missing and derive the corresponding equations of motion. Uses find_missing
and indexed_meanfield
to do so. Implementation for IndexedMeanfieldNoiseEquations.
Optional arguments
*order=de.order
: The order at which the cumulant_expansion
is performed on the newly derived equations. If nothing
, the order is inferred from the existing equations. *filter_func=nothing
: Custom function that specifies whether some averages should be ignored when completing a system. This works by calling filter!(filter_func, missed)
where missed
is the vector resulting from find_missing
. Occurrences of averages for which filter_func
returns false
are substituted to 0. *extra_indices
: A Vector of symbols, representing extra Index
entities, which are needed and created in the process of finding missing terms. *kwargs...
: Further keyword arguments are passed on to indexed_meanfield
and simplification.
see also: find_missing
, indexed_meanfield
, meanfield
, find_missing_sums
indexed_complete(de::MeanfieldEquations)
From a set of differential equation of averages, find all averages that are missing and derive the corresponding equations of motion. Uses find_missing
and indexed_meanfield
to do so.
Optional arguments
*order=de.order
: The order at which the cumulant_expansion
is performed on the newly derived equations. If nothing
, the order is inferred from the existing equations. *filter_func=nothing
: Custom function that specifies whether some averages should be ignored when completing a system. This works by calling filter!(filter_func, missed)
where missed
is the vector resulting from find_missing
. Occurrences of averages for which filter_func
returns false
are substituted to 0. *extra_indices
: A Vector of symbols, representing extra Index
entities, which are needed and created in the process of finding missing terms. *kwargs...
: Further keyword arguments are passed on to indexed_meanfield
and simplification.
see also: find_missing
, indexed_meanfield
, meanfield
, find_missing_sums
QuantumCumulants.split_sums
— Functionsplit_sums(term::SymbolicUtils.Symbolic,amount::Union{<:SymbolicUtils.Sym,<:Int64})
split_sums(me::MeanfieldEquations,amount)
Function, that splits sums inside a given term. The sums are split into a number of equal sums, specified in the amount
argument, where in only one of the sums the dependencies for the indices (non equal indices) is considered.
Arguments
*me::MeanfieldEquations
: A MeanfieldEquations
entity, which shall be evaluated, can also be any symbolic expression. *amount::Union{<:SymbolicUtils.Sym,<:Int64}
: A Number or Symbolic determining, in how many terms a sum is split
QuantumCumulants.find_missing_sums
— Functionfind_missing_sums(missed,de::MeanfieldEquations)
From a initial set of differential equation of averages, find all averages that are missing and inside a Symbolic sum. If a missing average contains one of the summation indices used in the equations, the Index
will be exchanged according to the keyword argument extra_indices
. Uses find_missing
.
Arguments
*missed
: A initial Vector of averages, representing the missed averages before calling this method. *de
: The set of equations, in which the missing averages are searched in.
Optional arguments
*extra_indices
: A Vector of symbols, representing extra Index
entities, which are needed and created in the process of finding missing terms. This argument is required, if the order of the Meanfield-Equations exceeds 1 and the number of given symbols must match the corresponding order. *checking
: A Bool defining if the algorithm checks for adjoint values and duplicates, before adding a found average into the missed
vector. *scaling
: A Bool defining the way how averages are added to the missed
vector. If true only averages, whose operators (without indices) are not already inside the missed
vector will be added.
see also: find_missing
, indexed_meanfield
, meanfield
, find_missing_sums
QuantumCumulants.IndexedCorrelationFunction
— FunctionIndexedCorrelationFunction(op1,op2,de0;steady_state=false,add_subscript=0,mix_choice=maximum)
The first-order two-time correlation function of two operators.
The first-order two-time correlation function of op1
and op2
evolving under the system de0
. The keyword steady_state
determines whether the original system de0
was evolved up to steady state. The arguments add_subscript
defines the subscript added to the name of op2
representing the constant time.
Note that the correlation function is stored in the first index of the underlying system of equations.
This is the indexed-version of the CorrelationFunction
and allows IndexedOperator
entities as argument-values. This function will automatically be called by CorrelationFunction
, when the original system de0
contains any types of Index
entities.
See also: CorrelationFunction
QuantumCumulants.indexed_complete!
— Functionindexed_complete!(de::MeanfieldEquations)
In-place version of indexed_complete
indexed_complete!(de::MeanfieldEquations)
In-place version of indexed_complete
QuantumCumulants.evalME
— FunctionevalME(me::MeanfieldEquations;limits::Dict{SymbolicUtils.BasicSymbolic,Int64}=Dict{SymbolicUtils.BasicSymbolic,Int64}())
Function, that evaluates a given MeanfieldEquations
entity and returns again equations, where indices have been inserted and sums evaluated.
Arguments
*me::MeanfieldEquations
: A MeanfieldEquations
entity, which shall be evaluated.
Optional argumentes
*limits=Dict{SymbolicUtils.BasicSymbolic,Int64}()
: A seperate dictionary, to specify any symbolic limits used when Index
entities were defined. This needs to be specified, when the equations contain summations, for which the upper bound is given by a Symbolic.
QuantumCumulants.scaleME
— FunctionscaleME(me::IndexedMeanfieldNoiseEquations)
Function, that evaluates a given IndexedMeanfieldNoiseEquations
entity and returns again equations, where indices have been inserted and sums evaluated, regarding the same relations, as done when calculating with oparators using a ClusterSpace
.
Arguments
*me::IndexedMeanfieldNoiseEquations
: A IndexedMeanfieldNoiseEquations
entity, which shall be evaluated.
scaleME(me::IndexedMeanfieldEquations)
Function, that evaluates a given MeanfieldEquations
entity and returns again equations, where indices have been inserted and sums evaluated, regarding the same relations, as done when calculating with oparators using a ClusterSpace
.
Arguments
*me::MeanfieldEquations
: A MeanfieldEquations
entity, which shall be evaluated.
QuantumCumulants.indexed_meanfield
— Functionindexed_meanfield(ops::Vector,H::QNumber,J::Vector;
Jdagger::Vector=adjoint.(J),rates=ones(length(J)))
Compute the set of equations for the indexed-operators IndexedOperator
in ops
under the Hamiltonian H
and with loss operators contained in J
. The resulting equation is equivalent to the Quantum-Langevin equation where noise is neglected. This is a modified version of the meanfield
function, that can now also take IndexedOperator
entities for both the ops
argument aswell as for the J
arguments. See also: meanfield
.
Arguments
*ops::Vector
: The operators of which the equations are to be computed. *H::QNumber
: The Hamiltonian describing the reversible dynamics of the system. *J::Vector{<:QNumber}
: A vector containing the collapse operators of the system. A term of the form $\sum_i J_i^\dagger O J_i - \frac{1}{2}\left(J_i^\dagger J_i O + OJ_i^\dagger J_i\right)$ is added to the Heisenberg equation.
Optional argumentes
*Jdagger::Vector=adjoint.(J)
: Vector containing the hermitian conjugates of the collapse operators. *rates=ones(length(J))
: Decay rates corresponding to the collapse operators in J
. *multithread=false
: Specify whether the derivation of equations for all operators in ops
should be multithreaded using Threads.@threads
. *simplify=true
: Specify whether the derived equations should be simplified. *order=nothing
: Specify to which order
a cumulant_expansion
is performed. If nothing
, this step is skipped. *mix_choice=maximum
: If the provided order
is a Vector
, mix_choice
determines which order
to prefer on terms that act on multiple Hilbert spaces. *iv=ModelingToolkit.t
: The independent variable (time parameter) of the system.
QuantumCumulants.subst_reds
— Functionsubst_reds(de::AbstractMeanfieldEquations)
Function that substitutes possible redundant conjugate averages inside the given Equations with their corresponding average given as the conjugate of one of the left-hand-side (of the equations) averages.
Optional Arguments
*scaling
: A Bool defining the way how averages are added to the missed
vector. If true only averages, whose operators (without indices) are not already inside the missed
vector will be added.
Measurement Backaction
QuantumCumulants.MeanfieldNoiseEquations
— TypeMeanfieldNoiseEquations
Mean field equations including a separate set of equations describing the noise generated by measurement backactions.
QuantumCumulants.IndexedMeanfieldNoiseEquations
— TypeIndexedMeanfieldNoiseEquations
Like a MeanfieldNoiseEquations
, but with symbolic indices.