levisim.multiphysics.output_modes¶
Covariance of propagating (filtered) cavity-output modes, jointly with the intracavity modes
levisim.multiphysics.covariance gives the steady state of the modes INSIDE the cavity. Light that leaves the cavity is a continuum of frequencies, so a propagating optical mode has to be defined by an envelope ξ (a temporal mode or, equivalently, a spectral filter):
a_ξ = ∫ ξ(ω) a_out(ω) dω/2π, ∫ |ξ(ω)|² dω/2π = 1 ⇔ [a_ξ, a_ξ†] = 1
with levisim’s Fourier convention O(ω) = ∫ O(t) e^{iωt} dt and a_out(ω) the detected output field (cavity input-output a_out = √κ a − a_in, then a beam splitter of efficiency η that mixes in vacuum). The quadratures Q_ξ = a_ξ + a_ξ† and P_ξ = i(a_ξ† − a_ξ) have the same normalisation as every other mode in levisim (vacuum covariance = identity), so the covariance matrix of (Q_ξ, P_ξ, X_b, P_b, …) can be handed straight to levisim.analysis.gaussian_states.
Everything here works on a QuadratureSystem, the linear Langevin equations in real quadratures:
du/dt = A u + B w(t), ½〈{w(t), w(t')ᵀ}〉 = N δ(t − t')
Only the symmetrised noise correlation N matters for the symmetrised covariance of a linear system. QuadratureSystem.from_multitrap takes it from a MultiTrap, and stack_cavity_modes joins several single-cavity-mode MultiTraps that share the same mechanics into ONE system with several cavity modes (e.g. two longitudinal modes driven by two tweezer lasers at different detunings, as in Deplano et al., Science 394, 113 (2026)), which a single MultiTrap cannot describe.
Two independent routes give the filtered-mode covariance:
output_mode_covariance integrates the cross-spectra of the output against the filter in the frequency domain (any filter shape, e.g. the flat window of rectangular_filter); the intracavity block is the exact Lyapunov solution.
cascade_lorentzian_filter appends a virtual one-sided ‘filter cavity’ fed by the output field to the drift matrix; its intracavity mode IS the temporal mode with the Lorentzian envelope of lorentzian_filter, so a single Lyapunov solve gives the same covariance. The tests check the two routes against each other.
- class levisim.multiphysics.output_modes.QuadratureSystem(A, B, N, labels, cavities=<factory>)[source]¶
Bases:
objectdu/dt = A u + B w with ½〈{w(t), w(t’)ᵀ}〉 = N δ(t − t’), in the quadrature basis u = (X_1, P_1, X_2, P_2, …) with vacuum covariance = identity
A: (n, n) real drift matrix [2π·Hz]
B: (n, m) real noise-input matrix [√(2π·Hz)]
N: (m, m) real symmetric noise correlation (identity for vacuum inputs) [·]
labels: one label per mode (quadrature pair) of u
cavities: {label: (κ, (column of Q_in, column of P_in))} for every cavity mode whose output field can be detected; the input-noise columns are those of w that enter that cavity
- classmethod from_multitrap(mtrap, cavity_label='cavity')[source]¶
The MultiTrap’s Linear Amplifier Model in quadratures
A = T·A_c·T⁻¹ (levisim.multiphysics.covariance), B = diag(√γ_k) and N = diag(2n_k + 1) on both quadratures of each operator pair, so that B·N·Bᵀ is covariance.quadrature_diffusion_matrix(mtrap). Each pair’s noise enters only its own mode, so the noise columns are in the same order as the modes.
- property diffusion_matrix¶
D = B·N·Bᵀ [2π·Hz]
- largest_growth_rate()[source]¶
max Re λ over the eigenvalues λ of A; the steady state exists only if this is negative [2π·Hz]
- levisim.multiphysics.output_modes.stack_cavity_modes(mtraps, cavity_labels, rtol=1e-09)[source]¶
One QuadratureSystem with several cavity modes coupled to the same mechanical modes
Each MultiTrap in mtraps describes the same particle(s) coupled to ONE cavity mode (its own κ, Δ and couplings); the result has the cavity modes first, in the order of cavity_labels, then the mechanical modes. The mechanical block of the drift matrix and the mechanical noise must be the same in every MultiTrap (checked to rtol), because they describe the same mechanics. Cavity modes interact only through the mechanics (no direct mode-mode coupling), which is the linearised coherent-scattering model with well-separated cavity modes.
- levisim.multiphysics.output_modes.add_mechanical_mode(system, label, Ω, couplings, heating, damping)[source]¶
The system with one more mechanical mode, coupled to cavity modes like levisim’s dimensions with a real coupling G = g (dP_c/dt ∋ 2g·X, dp/dt ∋ 2g·Q_c)
This is for motion that couples to the cavity through the SAME quadrature as the transverse modes at a node, e.g. the tweezer-axis motion projected onto a slightly tilted cavity axis. A MultiTrap z dimension instead couples with G = i·g, the node coherent-scattering phase.
Ω: frequency [2π·Hz]; couplings: {cavity label: g} [2π·Hz]; heating: phonon heating rate [2π·Hz]; damping: bath damping of both quadratures [2π·Hz] (the bath occupation is then heating/damping, as in levisim’s own baths)
- class levisim.multiphysics.output_modes.SpectralFilter(ξ, support=None, breakpoints=(), description='', center=0.0, scale=None)[source]¶
Bases:
objectEnvelope ξ(ω) of a propagating mode a_ξ = ∫ ξ(ω) a_out(ω) dω/2π
ξ: callable of an array of ω [2π·Hz] returning complex values [1/√(2π·Hz)]
support: list of (ω_lo, ω_hi) intervals outside which ξ = 0, or None for a filter without compact support
breakpoints: frequencies where ξ or its derivative jumps inside the support (integration panels end there)
center, scale: for a filter without compact support, the whole real axis is integrated over θ ∈ (−π/2, π/2) with ω = center + scale·tan θ, so no tail is cut off [2π·Hz]
- Parameters:
- levisim.multiphysics.output_modes.rectangular_filter(center, width)[source]¶
Flat window ξ(ω) = √(2π/Γ_ξ) for abs(ω − center) < Γ_ξ/2, else 0 (normalised: ∫ abs(ξ)² dω/2π = 1)
center, width [2π·Hz]. With levisim’s Fourier convention a cavity mode of detuning Δ responds at ω = −Δ, so the Stokes sideband of a blue-detuned drive (Δ ≈ +Ω) is selected by center = −Ω.
- levisim.multiphysics.output_modes.lorentzian_filter(center, width)[source]¶
ξ(ω) = √γ / (γ/2 − i(ω − center)) with γ = width (normalised: ∫ abs(ξ)² dω/2π = 1)
This is the envelope of the intracavity mode of a one-sided filter cavity of linewidth γ fed by the output field, da_f/dt = (−i·center − γ/2) a_f + √γ a_out (see cascade_lorentzian_filter). center, width [2π·Hz]
- levisim.multiphysics.output_modes.filter_norm(spectral_filter, ω_limits=None, points_per_panel=64, panels=200)[source]¶
∫ abs(ξ(ω))² dω/2π, which is 1 for a properly normalised envelope
- levisim.multiphysics.output_modes.output_mode_covariance(system, cavity, spectral_filter, η=1.0, modes=None, ω_limits=None, points_per_panel=32, panels=16, extra_breakpoints=())[source]¶
Joint covariance of the filtered output mode of cavity and intracavity modes
Returns V for u = (Q_ξ, P_ξ, X_1, P_1, …) with the intracavity modes modes (labels of system, default: all modes except cavity) after the filtered mode; vacuum = identity.
intracavity block: exact Lyapunov solution (QuadratureSystem.steady_state_covariance)
filtered-mode block and its cross-correlations with the intracavity modes: V_kl = ∫ Re[r_k(ω)* N r_l(ω)ᵀ] dω/2π with r the transfer rows from the noise to each observable, by composite Gauss-Legendre quadrature over the filter’s support and its mirror image (ξ*(−ω) enters P_ξ and Q_ξ). Equal-time intracavity quadratures have r = e_i·G(ω)·B.
η: detection efficiency (the losses mix vacuum into the detected field) [·]
ω_limits: (ω_lo, ω_hi) to integrate over when the filter has no compact support; by default such a filter is integrated over the whole axis through its tan mapping (SpectralFilter.scale) [2π·Hz]
extra_breakpoints: frequencies to start new integration panels at (e.g. sharp resonances)
- levisim.multiphysics.output_modes.rectangular_filter_scan(system, cavity, center, widths, η=1.0, modes=None, points_per_panel=16, max_panel_width=None)[source]¶
output_mode_covariance for rectangular windows of several widths around one center, at the cost of one evaluation of the transfer matrix
The flat window has amplitude √(2π/Γ_ξ), so its filtered-mode block scales as 2π/Γ_ξ and the cross-correlations as √(2π/Γ_ξ) times integrals of the unit window. Those integrals are summed panel by panel, with a panel edge at every window edge center ± Γ_ξ/2, and reused for every width. Returns an array of shape (len(widths), 2 + 2·len(modes), 2 + 2·len(modes)), in the order of widths. max_panel_width: longest panel [2π·Hz] (default: an eighth of the smallest width).
- levisim.multiphysics.output_modes.cascade_lorentzian_filter(system, cavity, center, width, η=1.0, label='filter')[source]¶
The system plus a virtual one-sided filter cavity driven by the detected output of cavity
da_f/dt = (−i·center − γ/2) a_f + √γ a_out with γ = width and a_out = √η(√κ a − a_in) + √(1 − η) a_v: the filter cavity does not act back on the system (it is cascaded), and in the steady state a_f is exactly the propagating mode with the envelope lorentzian_filter(center, width). Its covariance with the intracavity modes then follows from one Lyapunov solve of the returned (larger) system, with the filter mode last, labelled label. center, width [2π·Hz]