API

Hilbert Spaces

QuantumCumulants.NLevelSpaceType
NLevelSpace <: 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)
source
QuantumCumulants.ClusterSpaceType
ClusterSpace <: HilbertSpace
ClusterSpace(original_space,N,order)

A Hilbert space representing N identical copies of another Hilbert space, with correlations up to a specified order.

source
QuantumCumulants.:⊗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)
source

q-Numbers

QuantumCumulants.@qnumbersMacro
@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,)
source
QuantumCumulants.TransitionType
Transition <: 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
source

Mean field

QuantumCumulants.meanfieldFunction
meanfield(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=SymbolicUtils.Sym{Real}(:t): The independent variable (time parameter) of the system.

source
QuantumCumulants.acts_onFunction
acts_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.

source
QuantumCumulants.MeanfieldEquationsType
MeanfieldEquations <: 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.

source

Symbolic Numbers

QuantumCumulants.cnumbersFunction
cnumbers(symbols::Symbol...)
cnumbers(s::String)

Create symbolic cnumbers.

Expamples

julia> ps = cnumbers(:a, :b)
(a, b)

julia> cnumbers("a b") == ps
true
source

Average

QuantumCumulants.cumulant_expansionFunction
cumulant_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.

source
QuantumCumulants.cumulantFunction
cumulant(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)
0
source
QuantumCumulants.get_orderFunction
get_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
source

Correlation functions

QuantumCumulants.SpectrumType
struct 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).

source

Utility functions

QuantumCumulants.find_missingFunction
find_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.

see also: complete, complete!

source
QuantumCumulants.completeFunction
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 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. *kwargs...: Further keyword arguments are passed on to meanfield and simplification.

see also: find_missing, meanfield

source