API
Hilbert Spaces
SecondQuantizedAlgebra.HilbertSpace — TypeHilbertSpaceAbstract type for representing Hilbert spaces.
SecondQuantizedAlgebra.ProductSpace — TypeProductSpace <: HilbertSpaceStores a composite HilbertSpace consisting of multiple subspaces. Generally created by computing the tensor product ⊗ of subspaces.
SecondQuantizedAlgebra.FockSpace — TypeFockSpace <: HilbertSpaceHilbertSpace defining a Fock space for bosonic operators. See also: Destroy, Create
SecondQuantizedAlgebra.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)SecondQuantizedAlgebra.PauliSpace — TypePauliSpace <: HilbertSpaceHilbertSpace defining a Spin space for two-level atom Pauli operators. See also: Pauli, Create
SecondQuantizedAlgebra.SpinSpace — TypeSpinSpace <: HilbertSpaceHilbertSpace defining a Spin space for N > 1 identical two-level atom operators. See also: Spin, Create
SecondQuantizedAlgebra.PhaseSpace — TypePhaseSpace <: HilbertSpaceHilbertSpace defining the Phase space for the position and momentum operators. See also: Position, Momentum
SecondQuantizedAlgebra.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 ⊗.
q-Numbers
SecondQuantizedAlgebra.QSym — TypeQSym <: QNumberAbstract type representing fundamental operator types.
SecondQuantizedAlgebra.QTerm — TypeQTerm <: QNumberAbstract type representing noncommutative expressions.
SecondQuantizedAlgebra.@qnumbers — Macro@qnumbersConvenience 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,)SecondQuantizedAlgebra.Destroy — TypeDestroy <: QSymBosonic operator on a FockSpace representing the quantum harmonic oscillator annihilation operator.
SecondQuantizedAlgebra.Create — TypeCreate <: QSymBosonic operator on a FockSpace representing the quantum harmonic oscillator creation operator.
SecondQuantizedAlgebra.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)
σgeSecondQuantizedAlgebra.Pauli — TypePauli <: QSymPauli 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, respectively. 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)
σxSecondQuantizedAlgebra.Spin — TypeSpin <: QSymSpin 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, respectively. 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)
SxSecondQuantizedAlgebra.Position — TypePosition <: QSymPosition operator on a PhaseSpace.
SecondQuantizedAlgebra.Momentum — TypeMomentum <: QSymMomentum operator on a PhaseSpace.
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 arguments
*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.
SecondQuantizedAlgebra.commutator — Functioncommutator(a,b)Computes the commutator a*b - b*a.
SecondQuantizedAlgebra.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 <: AbstractMeanfieldEquationsType 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
SecondQuantizedAlgebra.CNumber — TypeSecondQuantizedAlgebra.Parameter — TypeParameter <: CNumberType used as symbolic type in a SymbolicUtils.Sym variable to represent a parameter.
SecondQuantizedAlgebra.cnumbers — Functioncnumbers(symbols::Symbol...)
cnumbers(s::String)Create symbolic cnumbers.
Expamples
julia> ps = cnumbers(:a, :b)
(a, b)
julia> cnumbers("a b") == ps
trueSecondQuantizedAlgebra.cnumber — Functioncnumber(symbols::Symbol)
cnumber(s::String)Create symbolic cnumber.
Expamples
julia> ps = cnumber(:a)
a
julia> cnumber("a") == ps
trueSecondQuantizedAlgebra.@cnumbers — Macro@cnumbers(ps...)Convenience macro to quickly define symbolic cnumbers.
Examples
julia> @cnumbers ω κ
(ω, κ)SecondQuantizedAlgebra.RNumber — TypeRNumber <: RealAbstract type for real symbolic numbers RealParameter.
SecondQuantizedAlgebra.RealParameter — TypeRealParameter <: RNumberType used as symbolic type in a SymbolicUtils.Sym variable to represent a real parameter.
SecondQuantizedAlgebra.rnumbers — Functionrnumbers(symbols::Symbol...)
rnumbers(s::String)Create symbolic rnumbers.
Expamples
julia> ps = rnumbers(:a, :b)
(a, b)
julia> rnumbers("a b") == ps
trueSecondQuantizedAlgebra.rnumber — Functionrnumber(symbols::Symbol)
rnumber(s::String)Create symbolic rnumber.
Expamples
julia> ps = rnumber(:a)
a
julia> rnumber("a") == ps
trueSecondQuantizedAlgebra.@rnumbers — Macro@rnumbers(ps...)Convenience macro to quickly define symbolic rnumbers.
Examples
julia> @rnumbers ω κ
(ω, κ)Average
SecondQuantizedAlgebra.average — Functionaverage(::QNumber, order)Compute the average of an operator. If order is given, the cumulant_expansion up to that order is computed immediately.
average(::QNumber)Compute the average of an operator.
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 nth 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)
0QuantumCumulants.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)
0Correlation functions
QuantumCumulants.CorrelationFunction — Typestruct CorrelationFunctionType representing the two-time first-order correlation function of two operators.
QuantumCumulants.Spectrum — Typestruct SpectrumType 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.
SecondQuantizedAlgebra.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
SecondQuantizedAlgebra.unique_ops — Functionunique_ops(ops)For a given list of operators, return only unique ones taking into account their adjoints.
SecondQuantizedAlgebra.unique_ops! — Functionunique_ops!(ops)In-place version of unique_ops.
SecondQuantizedAlgebra.fundamental_operators — Functionfundamental_operators(::HilbertSpace)Return all fundamental operators for a given Hilbertspace. For example, a FockSpace only has one fundamental operator, Destroy.
SecondQuantizedAlgebra.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.
SecondQuantizedAlgebra.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
Examples
julia> to_numeric(Destroy(FockSpace(:fock), :a), FockBasis(10)) Operator(dim=11x11) basis: Fock(cutoff=10)[...]
to_numeric(q::QNumber, b::QuantumOpticsBase.Basis, d::Dict)
to_numeric(q::QNumber, state, d::Dict)Map a symbolic operator q to a numeric (matrix) defined in the dictionary d. See also: numeric_average
SecondQuantizedAlgebra.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: to_numeric
numeric_average(avg::Average, state, d::Dict)
numeric_average(q::QNumber, state, d::Dict)From a symbolic average avg or operator q, map the operator defined in the dictionary d and compute the numerical average value for an with the given quantum state state. This state can either be of type QuantumOpticsBase.StateVector or QuantumOpticsBase.Operator.
See also: 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
SecondQuantizedAlgebra.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
IndexedOperatorare 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.
SecondQuantizedAlgebra.IndexedOperator — TypeIndexedOperator <: QSym
IndexedOperator(op::Union{Transition,Create,Destroy},ind::Index)Operator, associated with an index.
Fields:
- op: Operator, either a
Transition, aDestroyor aCreatecan be defined. - ind: The index, the operator will be associated with.
SecondQuantizedAlgebra.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.
SecondQuantizedAlgebra.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.
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.
SecondQuantizedAlgebra.SingleSum — TypeSingleSum <: QTermDefines a symbolic summation over a term, using one Index entity.
Fields:
- term: A multiplication of q-number terms. When the multiplication contains any
IndexedOperatorwith 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.
SecondQuantizedAlgebra.DoubleSum — TypeDoubleSum <: QTermDefines a symbolic summation over another SingleSum, using one Index entity. This corresponds to a double-summation over a multiplication of terms.
Fields:
- innerSum: A
SingleSumentity. - 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.
SecondQuantizedAlgebra.change_index — Functionchange_index(term,from::Index,to::Index)Exchanges all occurring indices inside the given term, that are equal to the from to the to index.
Examples
change_index(σⱼ²¹,j,i) = σᵢ²¹
change_index(σⱼ²¹ * σᵢ¹²,j,i) = σᵢ²²SecondQuantizedAlgebra.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) = σ₁²¹SecondQuantizedAlgebra.SpecialIndexedTerm — TypeSpecialIndexedTerm <: QTermA 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
Indextuples, specifying the constraints for the term. Each Tuple is considered to one constraint. e.g: (i,j) -> i ≠ j
SecondQuantizedAlgebra.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)]) = σᵢ²¹ * σⱼ²²SecondQuantizedAlgebra.IndexedAverageSum — TypeIndexedAverageSum <: CNumberDefines 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.
SecondQuantizedAlgebra.IndexedAverageDoubleSum — TypeIndexedAverageDoubleSum <: CNumberDefines a symbolic summation over an IndexedAverageSum, using a Index entity. This schematically represent a double-sum over a multiplication of averages.
Fields:
- innerSum: An
IndexedAverageSumentity. - 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.
SecondQuantizedAlgebra.NumberedOperator — TypeNumberedOperator <: QSymDefines 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, aDestroyor aCreatecan 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 arguments
*limits::Dict{BasicSymbolic,Int64}=Dict{Symbol,Int64}(): A separate 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 arguments
*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 arguments
*limits=Dict{SymbolicUtils.BasicSymbolic,Int64}(): A separate 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 arguments
*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 — TypeMeanfieldNoiseEquationsMean field equations including a separate set of equations describing the noise generated by measurement backactions.
QuantumCumulants.IndexedMeanfieldNoiseEquations — TypeIndexedMeanfieldNoiseEquationsLike a MeanfieldNoiseEquations, but with symbolic indices.