API Reference
SLH type
SLHQuantumSystems.SLH — Type
SLH(name, inputs, outputs, S, L, H)
An SLH triple describes an open quantum system. See Combes, arXiv.1611.00375
The name of the system should be unique. When multiple systems are combined, the names of their inputs and outputs will have the system name appended to them. The inputs and outputs describe 'ports' where signals leave and enter the system. Quantum systems must have the same number of inputs and outputs, which we denote by n.
size(S) = (n, n) <- S is an nxn matrix
size(L) = (n,)
size(H) = ()
The two ways of combining SLH systems are concatenate() and feedbackreduce()
SLH Operations
SLHQuantumSystems.concatenate — Function
concatenate(name, syslist::Vector{SLH})
creates a composite system with no interconnections. Combes eq. 59
When systems are concatenated, the names of their inputs, outputs, operators, parameters, and Hilbert spaces are 'promoted' by prepending the name of the system to the existing name. This prevents name collisions as long as all SLHSystems are created with a unique name.
SLHQuantumSystems.feedbackreduce — Function
feedbackreduce(A::SLH,output,input)
Connects the output port to the input port, reducing the number of outputs and inputs by one each. Combes eq 61.
Symbolic Utilities
SLHQuantumSystems.get_qnumbers — Function
get_qnumbers(expr)Extract all quantum operators from an expression.
Arguments
expr: A symbolic expression
Returns
- Set of quantum operators found in the expression
SLHQuantumSystems.get_cnumbers — Function
get_cnumbers(expr)Extract all symbolic parameters from an expression.
Arguments
expr: A symbolic expression
Returns
- Set of symbolic parameters found in the expression
SLHQuantumSystems.get_additive_terms — Function
get_additive_terms(expr)Extract additive terms from a symbolic expression.
Takes a symbolic expression and returns a list of terms that contain no addition, only multiplication. Summing all returned terms results in the original expression.
Arguments
expr: A symbolic expression
Returns
- Vector of terms
Subspaces and Mode Parameters
SLHQuantumSystems.param_key — Function
param_key(mode::Subspace, base::Symbol) → SymbolReturn the parameter dict key for base in the context of mode. For an unnamed mode (mode.name == ""), returns base directly. For a named mode, returns Symbol(mode.name, "_", base).
This is the single source of truth for parameter naming: all functions that look up mode parameters should use this rather than positional indexing.
SLHQuantumSystems.zpf_length — Function
Zero-point fluctuation amplitude [m]. x_zpf = √(ℏ / (2 m Ω))
SLHQuantumSystems.zpf_momentum — Function
Zero-point fluctuation momentum [kg⋅m/s].
SLHQuantumSystems.quadrature_scale — Function
quadrature_scale(subsys::MechanicalMode, params) → [x_zpf, p_zpf]SI conversion factors for the mechanical quadrature state vector. The dimensionless quadrature states relate to physical quantities as: xphys = √2 · xzpf · q pphys = √2 · pzpf · r where q = (b+b†)/√2 and r = i(b†-b)/√2 are the SLH quadrature coordinates.
State Space
SLHQuantumSystems.LadderBasis — Type
Ladder (creation/annihilation) operator basis. State vector ordered as (a₁, a₁†, a₂, a₂†, ...) after interlacing. ABCD matrices are complex-valued.
SLHQuantumSystems.QuadratureBasis — Type
Quadrature (amplitude/phase) operator basis. State vector ordered as (X₁, P₁, X₂, P₂, ...). All modes use the same 1/√2 unitary transform from the ladder basis. For optical modes: X = (a+a†)/√2, P = i(a†-a)/√2. For mechanical modes: q = (b+b†)/√2, r = i(b†-b)/√2 (dimensionless, normalized consistently with optical quadratures; SI conversion via xzpf, pzpf). ABCD matrices are real-valued for physical systems; all entries in rad/s.
Frequency Response
SLHQuantumSystems.fresponse_state2output — Function
fresponse_state2output(sys::QuantumStateSpace, freqs, from::Int, to::Int) → Vector{ComplexF64}Transfer from state quadrature index from to output quadrature index to over freqs [rad/s].
Computes C[to,:] * (iω·I - A)⁻¹ * eₓ for each ω, where eₓ is a unit vector selecting state from. For QuadratureBasis systems, states are ordered (x₁, p₁, x₂, p₂, …).
Implemented by passing a dummy system with B = eₓ, D = 0 to freqresp, so it inherits all of ControlSystems.jl's numerics (Hessenberg form, etc.) rather than using a naive matrix inverse.
Spectral Densities
SLHQuantumSystems.SpectralDensityMatrix — Type
SpectralDensityMatrixFrequency-resolved output noise spectral density matrix S_out(ω).
Stores S as a 3D array with shape (nout, nout, nω), following the same axis convention as freqresp: S[:, :, k] is the full matrix at freqs[k].
Field names contains the quadrature-expanded output port names.
SLHQuantumSystems.spectral_density — Function
spectral_density(sys::QuantumStateSpace, freqs; S_in=vacuum_noise(sys))
→ SpectralDensityMatrixCompute the output noise spectral density matrix
S_out(ω) = G(ω) · S_in · G†(ω)where G(ω) = freqresp(sys, freqs) is the transfer matrix.
Arguments
sys: A numeric (parameter-substituted) QuantumStateSpace.freqs: Vector of angular frequencies [rad/s].S_in: Input noise covariance. Defaults to vacuum (1/2)·I.
SLHQuantumSystems.vacuum_noise — Function
vacuum_noise(sys::QuantumStateSpace) → MatrixReturn the vacuum input noise covariance matrix (1/2)·I, sized for the number of input channels (2 quadratures per port).
Component Library
SLHQuantumSystems.cavity — Function
cavity(name)Create a basic optical cavity SLH system.
Creates a single-mode cavity with detuning and decay. The cavity has one input and one output port with direct transmission (S=1).
Arguments
name: Symbol identifying the cavity (used for operator and parameter naming)
Returns
SLH: System with Hamiltonian H = Δ·a†a and coupling L = [κa]
Parameters
κ: Cavity decay rateΔ: Cavity detuning from driving field
SLHQuantumSystems.squeezing_cavity — Function
squeezing_cavity(name)Create a squeezing cavity SLH system.
Creates a cavity that generates squeezed light through a parametric interaction (two-mode squeezing Hamiltonian).
Arguments
name: Symbol identifying the cavity (used for operator and parameter naming)
Returns
SLH: System with squeezing Hamiltonian H = iϵ(a†² - a²) and coupling L = [κ·a]
Parameters
κ: Cavity decay rateϵ: Squeezing strength
Function Index
SLHQuantumSystems.LadderBasisSLHQuantumSystems.QuadratureBasisSLHQuantumSystems.SLHSLHQuantumSystems.SpectralDensityMatrixSLHQuantumSystems.cavitySLHQuantumSystems.concatenateSLHQuantumSystems.feedbackreduceSLHQuantumSystems.fresponse_state2outputSLHQuantumSystems.get_additive_termsSLHQuantumSystems.get_cnumbersSLHQuantumSystems.get_qnumbersSLHQuantumSystems.param_keySLHQuantumSystems.quadrature_scaleSLHQuantumSystems.spectral_densitySLHQuantumSystems.squeezing_cavitySLHQuantumSystems.vacuum_noiseSLHQuantumSystems.zpf_lengthSLHQuantumSystems.zpf_momentum