Calculation methods¶
MultiTrap solves the same linear quantum Langevin equations (see
Conventions) by any of seven routes, selected with the
QuantumLinearTheoryMethod enum
passed to every spectrum function:
from levisim.multiphysics.enums import QuantumLinearTheoryMethod
mtrap.homodyne_spectrum(QuantumLinearTheoryMethod.NUMERICAL_HYBRIDISATION)
They exist to be compared: each makes a different part of the physics explicit, and agreement between routes that share no code is the main check on all of them.
How each method gets from the physical inputs to the spectra (names in code font are MultiTrap methods and properties; \(j\) labels a motion, \(n\) its particle, and \(2N+2\) counts the input noises):
flowchart TD
IN["Tweezer, Bead, Gas, Cavity"] --> DIMS["MultiTrap: one Dimension per motion j_n<br/>coupling G_j = g_j e^(iφ_n), susceptibility χ_j(ω), damping Γ_j<br/>cavity: κ, Δ, χ_c(ω)"]
subgraph LAM["Linear amplifier model: (1) (2) (3)"]
A["drift_matrix A<br/>all 2N+2 operators"] --> T["T_matrix<br/>T(ω) = (−iωI − A)⁻¹"]
T --> C["c_noise_vector<br/>ĉ = T ĉ_in"]
T --> TNT["(3) TNT<br/>S_cc† = T N T†<br/>position PSDs only"]
C --> L1["(1) LAM<br/>q̂_j and â, ↠sliced from ĉ"]
C --> L2["(2) Hybrid LAM<br/>q̂_j sliced from ĉ"]
end
subgraph HYB["Hybridisation: (4) (5)"]
R["R_jk(ω)<br/>light traced out"] --> D["derangement_matrix<br/>D = I − R"]
D --> H4["(4) Numerical<br/>H = D⁻¹"]
D --> H5["(5) Power series<br/>H = adj D / det D<br/>sums over derangement cycles"]
X1D["x1D_noise_vector<br/>q̂_j,1D: each motion alone"] --> QH
H4 --> QH["hybridised_positions<br/>x̂ = H x̂_1D"]
H5 --> QH
end
subgraph ANA["Analytic: (6) (7)"]
AN["gbar ḡ, M_norm<br/>transduction functions F, F̄"] --> QP["collective modes Q̂_φ, Q̂_φ†<br/>closed form"]
QP --> A6["(6) inside cavity<br/>â, ↠first"]
QP --> A7["(7) cavity output<br/>â_out, â_out† first<br/>â recovered by reversing input–output"]
A6 --> QA["q̂_j = i g_j μ_j(ω) Ĉ(φ_n) + √Γ_j Q̃_therm"]
A7 --> QA
end
DIMS --> A
DIMS --> R
DIMS --> X1D
DIMS --> AN
L2 --> LREB["light_noise_vectors from positions<br/>â = χ_c(ω) [i Σ G_j q̂_j + √κ ã_in]<br/>↠= χ_c*(−ω) [−i Σ G_j* q̂_j + √κ ã_in†]"]
QH --> LREB
L1 --> OUT["output_light_noise_vectors<br/>â_out = −√κ â + ã_in"]
LREB --> OUT
A6 --> OUT
A7 --> OUT
OUT --> HN["homodyne_noise_vector: â_out e^(iθ) + â_out† e^(−iθ)<br/>heterodyne_noise_vector: â_out"]
L1 --> QPOS["position noise vectors q̂_j"]
L2 --> QPOS
QH --> QPOS
QA --> QPOS
HN --> S["noise_vector_to_power_spectrum, noise_vectors_to_cross_spectrum<br/>Σ over the 2N+2 inputs, weighted by quantum_factor_per_noise_operator"]
QPOS --> S
S --> SO["homodyne_spectrum, heterodyne_spectrum"]
S --> SQ["position PSDs and CSDs<br/>all_position_power_spectra, position_power_spectrum, position_cross_spectrum"]
TNT --> SQ
Which method to use¶
Method |
How \(\hat{\mathbf c}(\omega)\) or \(\hat{\mathbf q}(\omega)\) is obtained |
Spectra |
Use it for |
|
|---|---|---|---|---|
(1) |
|
numerical inverse \(\mathbf T = (-i\omega\mathbf I - \mathbf A)^{-1}\) of the \((2N+2)\)-square drift problem at each \(\omega\) |
all |
the reference; default choice |
(2) |
|
mechanics from \(\mathbf T\), light rebuilt from the mechanics through \(\chi_\text{c}(\omega)\), \(\chi_\text{c}^*(-\omega)\) |
all |
checking the light pathway independently of LAM’s |
(3) |
|
matrix of all spectra \(\mathbf T \mathbf N \mathbf T^\dagger\) at once (Monteiro & Toroš, PRR 2, 023228 (2020), App. A) |
position PSDs only |
the fastest route to every position PSD; no input-output theory, so no optical spectra, and no single position on its own |
(4) |
|
light traced out; \(\hat{\mathbf q} = \mathbf D^{-1}\hat{\mathbf q}_\text{1D}\) with \(\mathbf D = \mathbf I - \mathbf R\) inverted numerically |
all |
seeing which pairs of motions hybridise, through \(R_{j_n k_m}(\omega)\); it is the method |
(5) |
|
as (4), with \(\mathbf D^{-1} = \operatorname{adj}\mathbf D / \det \mathbf D\) written out as sums over derangement cycles |
all |
the structure of the hybridisation order by order; cost grows factorially with \(N\), and needs pre-generated power-series pickles |
(6) |
|
closed form in the phase-dependent collective modes \(\hat{\mathrm Q}_\phi\), \(\hat{\mathrm Q}_\phi^\dagger\), solved for the intracavity field |
all |
analytic insight; see the limits below |
(7) |
|
as (6), solved for the output field first |
all |
as (6) |
How closely they agree¶
Maximum relative difference from LAM over each sweep, printed by
docs/guide/scripts/methods_agreement.py with every PR in this stack applied.
“Physical defaults” are traps built from the default tweezer, gas and cavity parameters
(50-350 kHz, 301 points); the toy systems are the shelf
parameter sets (250-320 kHz, 140 points). (5) is left out: it needs a pre-generated power-series
pickle for each layout, and levisim ships only those for 1×2, 2×2 and 3×2.
System |
(2) hom. |
(2) PSD |
(3) PSD |
(4) hom. |
(4) PSD |
(6), (7) hom. |
(6), (7) PSD |
|---|---|---|---|---|---|---|---|
physical defaults, 2×1 |
1.3e-15 |
0 |
1.0e-15 |
2.1e-15 |
1.8e-15 |
2.2e-15 |
1.3e-15 |
physical defaults, 2×2 |
1.8e-15 |
0 |
1.0e-15 |
2.0e-15 |
2.6e-15 |
3.1e-15 |
4.7e-15 |
physical defaults, 1×3 |
1.6e-15 |
0 |
8.9e-16 |
2.1e-15 |
1.8e-15 |
2.6e-15 |
1.8e-15 |
|
2.0e-15 |
0 |
7.8e-16 |
2.0e-14 |
2.2e-14 |
7.8e-15 |
7.8e-15 |
|
1.6e-15 |
0 |
7.8e-16 |
1.0e-14 |
9.8e-15 |
3.0e-15 |
3.1e-15 |
|
1.7e-15 |
0 |
8.9e-16 |
2.2e-14 |
2.3e-14 |
1.8e-14 |
2.8e-14 |
Every method agrees with LAM to machine precision (\(\lesssim 3\times10^{-14}\)) for every system in
the table, including unequal tweezer phases and particles off the node with two or three axes each,
where the intra-particle couplings \(g_{jk}\) are non-zero. The round-off grows with the number of
modes and with how closely the grid approaches the resonances: for the OFF_NODE pairs toy with
3×2 axes on the 140-point grid the largest difference is \(6\times10^{-14}\), and with 2×3 axes on
the 1402-point DEFAULT_ω_range it is \(3\times10^{-13}\). Until the analytic closed form was generalised to
include \(g_{jk}\), and its cancellation at exact resonances removed, (6) and (7) were off by up to
\(5.6\times10^{-3}\) (unequal phases) and by orders of magnitude (two axes per particle off the
node). (3) raises ValueError if asked
for a homodyne or heterodyne spectrum.
Code pathways¶
The rest of this page follows each method through the code: which function computes which mathematical object, and where it is passed. It was the main body of the repository README until the docs site existed.
Spectra¶
The aim of this document is to clarify the various code pathways and mathematical data flows that contribute to calculating the optical and mechanical spectra of interest in the multiparticle trap system. As such I will focus on how the key mathematical expressions flow through the functions of levisim, without expounding every detail of the calculations (one can just read the actual code for that, of course!).
Definitions¶
\(N\) is the total number of mechanical degrees of freedom (‘dimensions’), each with 2 quantum operators for phonon annihilation and creation \(\hat{b}_{j_n}, \hat{b}_{j_n}^\dagger\) for each Cartesian axis of motion \(j \in {x, y, z}\) of the \(n^\text{th}\) trapped particle
\(2N + 2\) is the total number of quantum operators (including 2 for cavity photon annihilation and creation \(\hat{a}, \hat{a}^\dagger\))
\(m_n\) is the mass of the particle in the \(n^\text{th}\) trap
\(\Omega_{j_n}\) is the resonant frequency for the \(j_n\) mechanical degree of freedom, as calculated by the linearised physics model of the multiparticle cavity trap
\(\hat{q}_{j_{n}}\) is the dimensionless position operator, i.e. in units of the zero-point motion \(q_{j_n, \text{zpf}} \equiv \sqrt{\frac{\hbar}{2} \cdot \frac{1}{m_n\Omega_{j_n}}}\)
\(\Gamma_{j_n}\) is the damping / loss rate for the \(j_n\) mechanical degree of freedom, assumed to be solely due to gas damping (i.e. does not account for optical sources)
\(\kappa\) is the optical damping / loss rate for light inside the cavity
Pre-calculated things include¶
for Linear Amplifier Model (LAM) methods¶
drift_matrix: \(\mathbf{A} \equiv\) matrix of coupling and damping frequencies for all creation and annihilation operators (i.e. the coefficients in the \(2N +2\) Heisenberg-Langevin equations). Crucially, this is static in time and thus is not a spectral quantity i.e. it does not functionally vary with \(\omega\) even in Fourier transformed coordinates.T_matrix: \(\mathbf{T}(\omega) \equiv (-i\omega\mathbf{I} - \mathbf{A})^{-1}\) is the ‘transform’ matrix that inverts the drift matrix after appropriate shifting in frequency space due to Fourier transformationc_in: \(\hat{\mathbf{c}}_{\text{in}}(\omega) \equiv (\sqrt{\kappa}\tilde{a}_{\text{in}}(\omega), \ \sqrt{\kappa}\tilde{a}_{\text{in}}^\dagger(\omega), \ \ldots, \ \sqrt{\Gamma_{j_n}}\tilde{b}_{j_n, \text{in}}(\omega), \sqrt{\Gamma_{j_n}}\tilde{b}_{j_n, \text{in}}^\dagger(\omega), \ \ldots)^\top\) is the column vector of input noises multiplied by the appropriate damping / loss ratenoise_matrix: \(\mathbf{N} \equiv \mathrm{diag} (\kappa (n_{\text{c}} + 1), \ \kappa n_{\text{c}}, \ \ldots, \ \Gamma_{j_n}(n_{j_n} + 1), \ \Gamma_{j_n} n_{j_n}, \ \ldots)\), where \(n_\text{c}\) is the shot noise (thermal photons inside the cavity, typically set to zero) and \(n_{j_n}\) is the number of thermal phonons in the given degree of freedom
for hybridisation methods¶
x1D_noise_vector: \(\mathbf{\hat{x}}_{\text{1D}}(\omega) \equiv (\ldots, \hat{q}_{j_n, \text{1D}}(\omega), \ \ldots)^\top\), the column vector of the solutions to the Heisenberg-Langevin equations for each dimension treated on its own, with every coupling to the other dimensions left outderangement_matrix: \(\mathbf{D}(\omega) \equiv \mathbf{I} - \mathbf{R}(\omega)\), which has 1s on the diagonal and minus the hybridisation functions \(R_{j_n k_m}(\omega)\) off it (relabelled \(a, b, c, \ldots\) below for brevity)\[\begin{split} \mathbf{D}(\omega) = \begin{pmatrix} 1 & -R_{ab}(\omega) & -R_{ac}(\omega) & \cdots \\ -R_{ba}(\omega) & 1 & -R_{bc}(\omega) & \cdots \\ -R_{ca}(\omega) & -R_{cb}(\omega) & 1 & \cdots \\ \vdots & \vdots & \vdots & \ddots \end{pmatrix}\end{split}\]The hybridisation function \(R_{j_n k_m}(\omega)\) gives how much of the full (hybridised) \(k_m\) position appears in the \(j_n\) position, so that each position is its 1D solution plus contributions from every other dimension,
\[ \hat{q}_{j_n}(\omega) = \hat{q}_{j_n, \text{1D}}(\omega) + \sum_{k_m \neq j_n} R_{j_n k_m}(\omega) \, \hat{q}_{k_m}(\omega),\]i.e. \(\mathbf{\hat{x}} = \mathbf{R} \cdot \mathbf{\hat{x}} + \mathbf{\hat{x}}_{\text{1D}}\), or \(\mathbf{D} \cdot \mathbf{\hat{x}} = \mathbf{\hat{x}}_{\text{1D}}\)
hybridisation_matrix: \(\mathbf{H}(\omega) \equiv \mathbf{D}^{-1}(\omega)\), which gives the hybridised positions from the 1D solutions, \(\mathbf{\hat{x}} = \mathbf{H} \cdot \mathbf{\hat{x}}_{\text{1D}}\). Numerical Hybridisation inverts \(\mathbf{D}\) numerically at each frequency; Power Series Hybridisation builds \(\mathbf{H} = \mathrm{adj} \, \mathbf{D} / \det \mathbf{D}\) from the pre-generated power series of the deranged determinant and adjugate (deranged_determinant,deranged_adjugate_matrix_entry), written as sums over the derangement cycles (determinant) and path-cycles (off-diagonal adjugate entries) of the \(R_{j_n k_m}\)
Notes on notation¶
next function / bit of code
\(\Uparrow\)
function / bit of code\(\leftarrow\) \(mathematical \ expressions \ for \ the \ code\)
The above indicates that the mathematical expression \(maths\) is calculated in the function / bit of code and passed up to the next function / bit of code above.
\(A[B]\) indicates the \(B\) component of the vector \(A\) (usually a noise vector, where each component is an input noise e.g. \(\hat{x}_1[\hat{a}_\text{in}^\dagger]\) refers to the input cavity photon creation noise’s contribution to the spectral value of the \(x_1\) position)
\(\hat{h}\) : hats indicate operator-valued quantities
\(\tilde{t}\) : tildes indicates an input noise operator, i.e. a stochastic entity that needs multiplication by something with dimensions of \(\sqrt{\omega}\) to be equal to the degree of freedom of noise it represents e.g. the combined term \(\sqrt{\kappa} \tilde{a}_\text{in}(\omega)\) contributes noise to the spectral value of \(\hat{a}(\omega)\)
I will assume from now that all operator, noise, and matrix quantites are spectral (with functional dependence on \(\omega\)) unless otherwise stated
\(\mathbb{M}_{\text{TOT}}\) is
M_normin the code, and the overlined transduction functions \(\overline{\mathbb{F}}_{a}, \overline{\mathbb{F}}_{\mathrm{Q}}\)… are theFFa,FFQ… functions (the doubledFstanding in for the overline). \(\mathbb{F}\) without an overline transduces an input noise into \(\mathrm{\hat{Q}}_\phi\), and \(\overline{\mathbb{F}}\) into \(\mathrm{\hat{Q}}^\dagger_\phi\)\(\chi_{j_n}(\omega)\) is the mechanical susceptibility of the \(j_n\) dimension (
dim.χ), and \(\mu_{j_n}(\omega) \equiv \chi_{j_n}(\omega) - \chi^*_{j_n}(-\omega)\) their difference (dim.μm), which is what multiplies the light quadrature in a hybridised position
(1) QuantumLinearTheoryMethod.LINEAR_AMPLIFIER_MODEL¶
All calculation routes under this method start with application of the \(\mathbf{T}\) matrix onto the \(\hat{\mathbf{c}}_\text{in}\) input noise vector, giving the operator vector \(\hat{\mathbf{c}}\), where each entry is itself a noise vector. Thus, this method linearly amplifies the noises into the physical solutions.
homodyne_spectrum & heterodyne_spectrum¶
noise_vector_to_power_spectrum
\(\Uparrow\)
homodyne_noise_vector\(\leftarrow\) \(\hat{a}_\text{out}^\dagger e^{i\theta_\text{hom}} + \hat{a}_\text{out}e^{-i\theta_\text{hom}}\); \(\theta_\text{hom} \equiv\) homodyning angle or phaseheterodyne_noise_vector\(\leftarrow\) \(\hat{a}_\text{out}\) *should be a sum of CSDs incorporating the beating frequency \(\Omega_\text{het}\)
\(\Uparrow\)
output_light_noise_vectors\(\leftarrow\) \(\begin{cases} \hat{a}_{\text{out}} \equiv -\sqrt{\kappa}\hat{a} + \tilde{a}_{\text{in}} & \\ \hat{a}_{\text{out}}^\dagger \equiv -\sqrt{\kappa}\hat{a}^\dagger + \tilde{a}_{\text{in}}^\dagger &\end{cases}\)
\(\Uparrow\)
light_noise_vectors\(\leftarrow\) \(\begin{cases} \hat{a} = \hat{\mathbf{c}}[\hat{a}] & \\ \hat{a}^\dagger = \hat{\mathbf{c}}[\hat{a}^\dagger] &\end{cases}\)
\(\Uparrow\)
c_noise_vector\(\leftarrow\) \(\hat{\mathbf{c}}\)
\(\Uparrow\)
T_matrix @ c_in\(\leftarrow\) \(\mathbf{T} \cdot \hat{\mathbf{c}}_\text{in}\)
all_position_power_spectra¶
noise_vector_to_power_spectrum
\(\Uparrow\)
hybridised_positions\(\leftarrow\) all \(\hat{q}_{j_n} \equiv (\hat{b}_{j_n}^\dagger + \hat{b}_{j_n})\) \(\leftarrow\) all \(\begin{cases} \hat{b}_{j_n} = \hat{\mathbf{c}}[\hat{b}_{j_n}] & \\ \hat{b}_{j_n}^\dagger = \hat{\mathbf{c}}[\hat{b}_{j_n}^\dagger] &\end{cases}\)
\(\Uparrow\)
c_noise_vector\(\leftarrow\) \(\hat{\mathbf{c}}\)
\(\Uparrow\)
T_matrix @ c_in\(\leftarrow\) \(\mathbf{T} \cdot \hat{\mathbf{c}}_\text{in}\)
position_power_spectrum / position_cross_spectrum¶
noise_vector_to_power_spectrum/noise_vectors_to_cross_spectrum
\(\Uparrow\)
hybridised_position_noise_vector\(\leftarrow\) only one at a time at a time (inefficient!) \(\hat{q}_{j_n} \equiv (\hat{b}_{j_n}^\dagger + \hat{b}_{j_n})\)
\(\Uparrow\)
hybridised_positions[label]\(\leftarrow\) all \(\begin{cases} \hat{b}_{j_n} = \hat{\mathbf{c}}[\hat{b}_{j_n}] & \\ \hat{b}_{j_n}^\dagger = \hat{\mathbf{c}}[\hat{b}_{j_n}^\dagger] &\end{cases}\)
\(\Uparrow\)
c_noise_vector\(\leftarrow\) \(\hat{\mathbf{c}}\)
\(\Uparrow\)
T_matrix @ c_in\(\leftarrow\) \(\mathbf{T} \cdot \hat{\mathbf{c}}_\text{in}\)
(2) QuantumLinearTheoryMethod.HYBRID_LINEAR_AMPLIFIER_MODEL¶
This method is characterised again by starting with the linear amplification of the noises \(\hat{\mathbf{c}} = \mathbf{T}\cdot\hat{\mathbf{c}}_\text{in}\), but then it deviates by using the phonon entries \(\hat{b}_{j_n, \text{in}}, \hat{b}_{j_n, \text{in}}^\dagger\) to calculate the light operators \(\hat{a}, \hat{a}^\dagger\). Thus only the calculation of optical spectra here differs as compared to method (1) above.
homodyne_spectrum & heterodyne_spectrum¶
noise_vector_to_power_spectrum
\(\Uparrow\)
homodyne_noise_vector\(\leftarrow\) \(\hat{a}_\text{out}^\dagger e^{i\theta_\text{hom}} + \hat{a}_\text{out}e^{-i\theta_\text{hom}}\)heterodyne_noise_vector\(\leftarrow\) \(\hat{a}_\text{out}\)
\(\Uparrow\)
output_light_noise_vectors\(\leftarrow\) \(\begin{cases} \hat{a}_{\text{out}} \equiv -\sqrt{\kappa}\hat{a} + \tilde{a}_{\text{in}} & \\ \hat{a}_{\text{out}}^\dagger \equiv -\sqrt{\kappa}\hat{a}^\dagger + \tilde{a}_{\text{in}}^\dagger &\end{cases}\)
\(\Uparrow\)
light_noise_vectors\(\leftarrow\) \(\begin{cases} \hat{a} = \chi_{\text{c}}(\omega)[i \sum_{j_n}G_{j_n} \hat{q}_{j_n} + \sqrt{\kappa}\tilde{a}_{\text{in}}] & \\ \hat{a}^\dagger = \chi^*_{\text{c}}(-\omega)[-i \sum_{j_n}G^*_{j_n} \hat{q}_{j_n} + \sqrt{\kappa}\tilde{a}_{\text{in}}^\dagger] &\end{cases}\)
\(\Uparrow\)
hybridised_positions\(\leftarrow\) all \(\hat{q}_{j_n} \equiv (\hat{b}_{j_n}^\dagger + \hat{b}_{j_n})\) \(\leftarrow\) all \(\begin{cases} \hat{b}_{j_n} = \hat{\mathbf{c}}[\hat{b}_{j_n}] & \\ \hat{b}_{j_n}^\dagger =\hat{\mathbf{c}}[\hat{b}_{j_n}^\dagger] &\end{cases}\)
\(\Uparrow\)
c_noise_vector\(\leftarrow\) \(\hat{\mathbf{c}}\)
\(\Uparrow\)
T_matrix @ c_in\(\leftarrow\) \(\mathbf{T} \cdot \hat{\mathbf{c}}_\text{in}\)
all_position_power_spectra¶
noise_vector_to_power_spectrum
\(\Uparrow\)
hybridised_positions\(\leftarrow\) all \(\hat{q}_{j_n} \equiv (\hat{b}_{j_n}^\dagger + \hat{b}_{j_n})\) \(\leftarrow\) all \(\begin{cases} \hat{b}_{j_n} = \hat{\mathbf{c}}[\hat{b}_{j_n}] & \\ \hat{b}_{j_n}^\dagger = \hat{\mathbf{c}}[\hat{b}_{j_n}^\dagger] &\end{cases}\)
\(\Uparrow\)
c_noise_vector\(\leftarrow\) \(\hat{\mathbf{c}}\)
\(\Uparrow\)
T_matrix @ c_in\(\leftarrow\) \(\mathbf{T} \cdot \hat{\mathbf{c}}_\text{in}\)
position_power_spectrum / position_cross_spectrum¶
noise_vector_to_power_spectrum/noise_vectors_to_cross_spectrum
\(\Uparrow\)
hybridised_position_noise_vector\(\leftarrow\) only one at a time (inefficient!) \(\hat{q}_{j_n} \equiv (\hat{b}_{j_n}^\dagger + \hat{b}_{j_n})\)
\(\Uparrow\)
hybridised_positions[label]\(\leftarrow\) all \(\begin{cases} \hat{b}_{j_n} = \hat{\mathbf{c}}[\hat{b}_{j_n}] & \\ \hat{b}_{j_n}^\dagger = \hat{\mathbf{c}}[\hat{b}_{j_n}^\dagger] &\end{cases}\)
\(\Uparrow\)
c_noise_vector\(\leftarrow\) \(\hat{\mathbf{c}}\)
\(\Uparrow\)
T_matrix @ c_in\(\leftarrow\) \(\mathbf{T} \cdot \hat{\mathbf{c}}_\text{in}\)
(3) QuantumLinearTheoryMethod.TNT_LINEAR_AMPLIFIER_MODEL¶
This method is unique in that it is only able to calculate position spectra all at once (and not optical spectra at all, since it does not account for input-output theory) as it goes straight to the array of all spectral densities (power and cross) \(S_{\mathbf{c}\hat{\mathbf{c}}}\) via the ‘TNT’ expression that effectively diagonalises the systems noises according to its damping and coupling rates. Since the array contains the PSDs and CSDs of the quantum operators (and not the quadrature operators), both the diagonal terms and off-diagonal terms need to be added to get the positions.
all_position_power_spectra¶
position_power_spectra_array\(\leftarrow\) all \(S_{j_n j_n} = \overbrace{S_{\mathbf{c} \mathbf{c}^\dagger}[\hat{b}_{j_n}, \hat{b}_{j_n}] + S_{\mathbf{c} \mathbf{c}^\dagger}[\hat{b}_{j_n}^\dagger, \hat{b}_{j_n}^\dagger]}^\text{diagonal terms} + \overbrace{S_{\mathbf{c} \mathbf{c}^\dagger}[\hat{b}_{j_n}^\dagger, \hat{b}_{j_n}] + S_{\mathbf{c} \mathbf{c}^\dagger}[\hat{b}_{j_n}, \hat{b}_{j_n}^\dagger]}^\text{off-diagonal terms}\)
\(\Uparrow\)
quantum_operator_spectral_density_array\(\leftarrow\) \(S_{\mathbf{c} \mathbf{c}^\dagger} \equiv \mathbf{T} \mathbf{N} \mathbf{T}^\dagger\)
\(\Uparrow\)
T_matrix @ N_matrix @ T_matrix.H\(\leftarrow\) \(\mathbf{T} \mathbf{N} \mathbf{T}^\dagger\)
(4) QuantumLinearTheoryMethod.NUMERICAL_HYBRIDISATION¶
This method is characterised by the numerical matrix inversion of the derangement matrix \(\mathbf{D}\), that gives the hybridisation matrix \(\mathbf{H}\). Since the matrix that is inverted here is \(N \times N\), it is typically faster than the \((2N + 2) \times (2N + 2)\) matrix inversion of the linear amplification methods.
homodyne_spectrum & heterodyne_spectrum¶
noise_vector_to_power_spectrum
\(\Uparrow\)
homodyne_noise_vector\(\leftarrow\) \(\hat{a}_\text{out}^\dagger e^{i\theta_\text{hom}} + \hat{a}_\text{out}e^{-i\theta_\text{hom}}\)heterodyne_noise_vector\(\leftarrow\) \(\hat{a}_\text{out}\)
\(\Uparrow\)
output_light_noise_vectors\(\leftarrow\) \(\begin{cases} \hat{a}_{\text{out}} \equiv -\sqrt{\kappa}\hat{a} + \tilde{a}_{\text{in}} & \\ \hat{a}_{\text{out}}^\dagger \equiv -\sqrt{\kappa}\hat{a}^\dagger + \tilde{a}_{\text{in}}^\dagger &\end{cases}\)
\(\Uparrow\)
light_noise_vectors\(\leftarrow\) \(\begin{cases} \hat{a} = \chi_{\text{c}}[i \sum_{j_n}G_{j_n} \hat{q}_{j_n} + \sqrt{\kappa}\tilde{a}_{\text{in}}] & \\ \hat{a}^\dagger = \chi^*_{\text{c}}(-\omega)[-i \sum_{j_n}G^*_{j_n} \hat{q}_{j_n} + \sqrt{\kappa}\tilde{a}_{\text{in}}^\dagger] &\end{cases}\)
\(\Uparrow\)
hybridised_positions\(\leftarrow\) all \(\hat{q}_{j_n}\) via \(\mathbf{\hat{x}} \equiv (\ldots, \hat{q}_{j_n}, \ \ldots)^\top = \mathbf{H} \cdot \mathbf{\hat{x}}_{\text{1D}}\)
\(\Uparrow\)
hybridisation_matrix\(\leftarrow\) \(\mathbf{H} \equiv \mathbf{D}^{-1}\)
\(\Uparrow\)
np.linalg.inv(derangement_matrix)\(\leftarrow\) \(\mathbf{D}^{-1} \equiv (\mathbf{I} - \mathbf{R})^{-1}\)
all_position_power_spectra¶
noise_vector_to_power_spectrum
\(\Uparrow\)
hybridised_positions\(\leftarrow\) all \(\hat{q}_{j_n}\) via \(\mathbf{\hat{x}} \equiv (\ldots, \hat{q}_{j_n}, \ \ldots)^\top = \mathbf{H} \cdot \mathbf{\hat{x}}_{\text{1D}}\)
\(\Uparrow\)
hybridisation_matrix\(\leftarrow\) \(\mathbf{H} \equiv \mathbf{D}^{-1}\)
\(\Uparrow\)
np.linalg.inv(derangement_matrix)\(\leftarrow\) \(\mathbf{D}^{-1} \equiv (\mathbf{I} - \mathbf{R})^{-1}\)
position_power_spectrum / position_cross_spectrum¶
noise_vector_to_power_spectrum/noise_vectors_to_cross_spectrum
\(\Uparrow\)
hybridised_position_noise_vector
\(\Uparrow\)
hybridised_positions[label]\(\leftarrow\) only one at a time (inefficient!) \(\hat{q}_{j_n}\) via \(\mathbf{\hat{x}} \equiv (\ldots, \hat{q}_{j_n}, \ \ldots)^\top = \mathbf{H} \cdot \mathbf{\hat{x}}_{\text{1D}}\)
\(\Uparrow\)
hybridisation_matrix\(\leftarrow\) \(\mathbf{H} \equiv \mathbf{D}^{-1}\)
\(\Uparrow\)
np.linalg.inv(derangement_matrix)\(\leftarrow\) \(\mathbf{D}^{-1} \equiv (\mathbf{I} - \mathbf{R})^{-1}\)
(5) QuantumLinearTheoryMethod.POWER_SERIES_HYBRIDISATION¶
This methods is characterised by symbolic matrix inversion that uses combinatorial solutions for the determinant and adjugate matrix of the derangement matrix involving power series of hybridisation functions. This method is unique in the ability calculate a single position without calculating any others, by picking out a particular row of the adjugate matrix. However, this method becomes incredibly slow for \(N > 6\), since the symbolic inversion requires factorial scaling \(O(N!)\).
homodyne_spectrum & heterodyne_spectrum¶
noise_vector_to_power_spectrum
\(\Uparrow\)
homodyne_noise_vector\(\leftarrow\) \(\hat{a}_\text{out}^\dagger e^{i\theta_\text{hom}} + \hat{a}_\text{out}e^{-i\theta_\text{hom}}\)heterodyne_noise_vector\(\leftarrow\) \(\hat{a}_\text{out}\)
\(\Uparrow\)
output_light_noise_vectors\(\leftarrow\) \(\begin{cases} \hat{a}_{\text{out}} \equiv -\sqrt{\kappa}\hat{a} + \tilde{a}_{\text{in}} & \\ \hat{a}_{\text{out}}^\dagger \equiv -\sqrt{\kappa}\hat{a}^\dagger + \tilde{a}_{\text{in}}^\dagger &\end{cases}\)
\(\Uparrow\)
light_noise_vectors\(\leftarrow\) \(\begin{cases} \hat{a} = \chi_{\text{c}}[i \sum_{j_n}G_{j_n} \hat{q}_{j_n} + \sqrt{\kappa}\tilde{a}_{\text{in}}] & \\ \hat{a}^\dagger = \chi^*_{\text{c}}(-\omega)[-i \sum_{j_n}G^*_{j_n} \hat{q}_{j_n} + \sqrt{\kappa}\tilde{a}_{\text{in}}^\dagger] &\end{cases}\)
\(\Uparrow\)
hybridised_positions\(\leftarrow\) all \(\hat{q}_{j_n}\) via \(\mathbf{\hat{x}} \equiv (\ldots, \hat{q}_{j_n}, \ \ldots)^\top = \mathbf{H} \cdot \mathbf{\hat{x}}_{\text{1D}}\)
\(\Uparrow\)
hybridisation_matrix\(\leftarrow\) \(\mathbf{H} \equiv \mathbf{D}^{-1}\)
\(\Uparrow\)
deranged_adjugate_matrix / deranged_determinant\(\leftarrow\) \(\mathbf{D}^{-1} \equiv \frac{\mathrm{adj} \ \mathbf{D}}{\det \mathbf{D}}\)
all_position_power_spectra¶
noise_vector_to_power_spectrum
\(\Uparrow\)
hybridised_positions\(\leftarrow\) all \(\hat{q}_{j_n}\) via \(\mathbf{\hat{x}} \equiv (\ldots, \hat{q}_{j_n}, \ \ldots)^\top = \mathbf{H} \cdot \mathbf{\hat{x}}_{\text{1D}}\)
\(\Uparrow\)
hybridisation_matrix\(\leftarrow\) \(\mathbf{H} \equiv \mathbf{D}^{-1}\)
\(\Uparrow\)
deranged_adjugate_matrix / deranged_determinant\(\leftarrow\) \(\mathbf{D}^{-1} \equiv \frac{\mathrm{adj} \ \mathbf{D}}{\det \mathbf{D}}\)
position_power_spectrum / position_cross_spectrum¶
noise_vector_to_power_spectrum/noise_vectors_to_cross_spectrum
\(\Uparrow\)
hybridised_position_noise_vector\(\leftarrow\) one \(\hat{q}_{j_n}\) for PSD, two for CSD
\(\Uparrow\)
deranged_adjugate_matrix_row @ x1D_noise_vector / deranged_determinant\(\leftarrow\) \(\hat{q}_{j_n} = \frac{[\mathrm{adj} \ \mathbf{D}(\omega)]_{j_n \ \text{row}}}{\det \mathbf{D}} \cdot \mathbf{\hat{x}}_{\text{1D}}\)
(6) QuantumLinearTheoryMethod.ANALYTIC_INSIDE_CAVITY¶
Both analytic methods replace matrix inversion with the closed-form solution for the two phase-dependent collective modes \(\mathrm{\hat{Q}}_\phi, \mathrm{\hat{Q}}^\dagger_\phi\), so the cost is independent of \(N\) and, like Power Series H, a single position can be had without solving for any other. This one solves for the intracavity field first and reaches the output field through the input-output relations.
homodyne_spectrum & heterodyne_spectrum¶
noise_vector_to_power_spectrum
\(\Uparrow\)
homodyne_noise_vector\(\leftarrow\) \(\hat{a}_\text{out}^\dagger e^{i\theta_\text{hom}} + \hat{a}_\text{out}e^{-i\theta_\text{hom}}\)heterodyne_noise_vector\(\leftarrow\) \(\hat{a}_\text{out}\)
\(\Uparrow\)
output_light_noise_vectors\(\leftarrow\) \(\begin{cases} \hat{a}_{\text{out}} \equiv -\sqrt{\kappa}\hat{a} + \tilde{a}_{\text{in}} & \\ \hat{a}_{\text{out}}^\dagger \equiv -\sqrt{\kappa}\hat{a}^\dagger + \tilde{a}_{\text{in}}^\dagger &\end{cases}\)
\(\Uparrow\)
light_noise_vectors\(\leftarrow\) \(\hat{a}, \hat{a}^\dagger\) in terms of the collective modes, where \(\bar{g}\) is the total collective coupling rate (gbar)
all_position_power_spectra¶
noise_vector_to_power_spectrum
\(\Uparrow\)
hybridised_positions\(\leftarrow\) each row filled in turn byhybridised_position_noise_vectorunlike every hybridisation method, there is no matrix to invert, so the rows are independent of one another
\(\Uparrow\)
hybridised_position_noise_vector\(\leftarrow\) \(\hat{q}_{j_n} = ig_{j_n} \mu_{j_n} \hat{C}(\phi_n) + \sqrt{\Gamma_{j_n}} \tilde{\mathrm{Q}}_{\text{THERM}, j_n}\)\(\hat{C}(\phi_n) \equiv \hat{a}^\dagger e^{i\phi_n} + \hat{a}e^{-i\phi_n}\) is the quadrature of cavity light this dimension couples to
\(\Uparrow\)
light_noise_vectors\(\leftarrow\) \(\hat{a}, \hat{a}^\dagger\) as above
position_power_spectrum / position_cross_spectrum¶
noise_vector_to_power_spectrum/noise_vectors_to_cross_spectrum
\(\Uparrow\)
hybridised_position_noise_vector\(\leftarrow\) one \(\hat{q}_{j_n}\) for PSD, two for CSDas for Power Series H, no other dimension’s solution is needed - but here because the collective-mode solution is closed-form rather than because a single adjugate row can be picked out
\(\Uparrow\)
light_noise_vectors\(\leftarrow\) \(\hat{a}, \hat{a}^\dagger\) as above
(7) QuantumLinearTheoryMethod.ANALYTIC_CAVITY_OUTPUT¶
The same closed-form collective-mode solution as (6), but arranged the other way round: the output field is written directly in terms of the input noises, and light_noise_vectors recovers the intracavity field by reversing the input-output relations. The two should agree everywhere, and are compared against each other in tests/test_noise_vector_equivalence.py.
homodyne_spectrum & heterodyne_spectrum¶
noise_vector_to_power_spectrum
\(\Uparrow\)
homodyne_noise_vector\(\leftarrow\) \(\hat{a}_\text{out}^\dagger e^{i\theta_\text{hom}} + \hat{a}_\text{out}e^{-i\theta_\text{hom}}\)heterodyne_noise_vector\(\leftarrow\) \(\hat{a}_\text{out}\)
\(\Uparrow\)
output_light_noise_vectors\(\leftarrow\) each component of \(\hat{a}_{\text{out}}\) written straight onto the \(2N + 2\) input noises
The \(1 - \kappa\chi_{\text{c}}\) terms are what is left of \(\hat{a}_{\text{out}} = -\sqrt{\kappa}\hat{a} + \tilde{a}_{\text{in}}\) once \(\hat{a}[\tilde{a}_{\text{in}}] = \sqrt{\kappa}\chi_{\text{c}}\) is substituted in - the input noise that reflects straight off the cavity rather than entering it. The \(e^{\pm i\phi_n}\) signs follow tweezer_phase_sign_convention; the expressions above are written for the \(+\) convention.
all_position_power_spectra¶
identical to (6) above - the positions do not depend on which side of the input-output relations was solved first, so this method reaches them through the same
hybridised_positions\(\rightarrow\)hybridised_position_noise_vector\(\rightarrow\)light_noise_vectorschain
\(\Uparrow\)
light_noise_vectors\(\leftarrow\) \(\hat{a}, \hat{a}^\dagger\) recovered by reversing the relations above, i.e. \(\hat{a} = (\tilde{a}_{\text{in}} - \hat{a}_{\text{out}})/\sqrt{\kappa}\)pointlessly convoluted, as noted in the noise-vector section below, but it does mean the two analytic methods exercise different code and so can be checked against each other
position_power_spectrum / position_cross_spectrum¶
identical to (6) above
Noise vectors¶
\(N \equiv\) number of dimensions
\(2N + 2 =\) number of input noises (2 per dimension, + 2 from the shared cavity light)
\(F \equiv\) number of \(\omega\) values in ω_range property
(1) hybridisation_matrix¶
Returns: \(\Rightarrow (N, N)\)-shaped numpy.matrix: matrix of coefficients of 1D position contributions to fully hybridised positions i.e. each entry is a hybridisation solution \(\mathbf{H} \equiv (h_{j_n k_m})\)
Numerical Hybridisation
Directly inverts the derangement matrix
i.e. \(\mathbf{H} \equiv \mathbf{D}^{-1} \equiv (\mathbf{I} - \mathbf{R})^{-1}\)
\(\mathbf{R}\) is a matrix with
\(0\)’s on the diagonal
hybridisation functions \(R_{j_n k_m}\) on all off-diagonals
\(\mathbf{I}\) the identity matrix
Power Series Hybridisation
Constructs two power series of hybridisation terms
One power series for the determinant \(\det (\mathbf{D})\)
One power series for adjugate matrix \(\mathrm{adj}(\mathbf{D})\)
Defined as the transpose of the matrix of cofactors
A cofactor is the determinant of a matrix’s minor
A minor is the matrix left over when deleting a given row and given column of a given matrix
Divides the adjugate matrix by the determinant
i.e. \(\mathbf{D}^{-1} \equiv \frac{\mathrm{adj}(\mathbf{D})}{\det (\mathbf{D})}\)
ALL OTHERS METHODS
not relevant
(2) hybridised_positions¶
Returns: \(\Rightarrow (N, 2N + 2)\)-shaped numpy.ndarray: column vector of each dimension’s position operator as a noise vector
LAM (but not TNT)
Takes the relevant \(\hat{b}_{j_n}, \hat{b}_{j_n}^\dagger\) entries from
c_noise_vectori.e. \(\hat{\mathbf{c}} = \mathbf{T} \cdot \hat{\mathbf{c}}_{\text{in}}\)
\(\mathbf{T} \equiv (-i\omega\mathbf{I} - \mathbf{A})^{-1}\)
\(\mathbf{A} \equiv\) “drift” matrix of couplings
Hybridisation
Multiplies
hybridisation_matrix @ x1D_noise_vectori.e. \(\mathbf{\hat{x}} = \mathbf{H} \cdot \mathbf{\hat{x}}_\text{1D}\)
Analytic
Fills out each entry via
hybridised_position_noise_vector
(3) hybridised_position_noise_vector¶
Returns: \(\Rightarrow (2N + 2,)\)-shaped numpy.ndarray: noise vector of a given dimension’s position operator
Analytic
Takes \(\hat{a},\hat{a}^\dagger\) from
light_noise_vectorsto directly calculate \(\hat{q}_{j_n} = ig_{j_n} \mu_{j_n} \hat{C}(\phi_n) + \sqrt{\Gamma} \tilde{Q}_{\text{THERM}}\)\(\hat{C}(\phi_n) \equiv \hat{a}^\dagger e^{i\phi_n} + \hat{a}e^{-i\phi_n}\)
using the \(+\) sign convention for the per-tweezer phase
Power Series Hybridisation
Constructs a particular row of the adjugate matrix
Then does
adj_row @ x1D_noise_vector / deranged_determinanti.e. \(\hat{q}_{j_n} = \sum_{k_m} h_{j_n k_m} \hat{q}_{k_m, \text{1D}}\)
ALL OTHER METHODS: (LAM, Hybrid LAM, and Numerical H)
Calculates the full
hybridised_positionsand simply takes the relevant entry from it
(4) light_noise_vectors¶
Returns: \(\Rightarrow\) 2-tuple of \((2N + 2,)\)-shaped numpy.ndarrays: noise vectors of the annihilation and creation operators \(\hat{a}, \hat{a}^\dagger\) of the shared cavity light mode
Analytic Inside Cavity
Takes the phase-dependent collective position operator \(\mathrm{\hat{Q}}_\phi \equiv \sum_{j_n} \frac{g_{j_n}}{\bar{g}} e^{i\phi_n} \hat{q}_{j_n} = \mathbb{M}_{\text{TOT}}^{-1}[\mathbb{F}_a \tilde{a}_{\text{in}} + \ldots]\) etc.
Plugs this into \(\hat{a} = \chi_{\text{c}}(\omega)[i\bar{g}\mathrm{\hat{Q}}_\phi + \sqrt{\kappa}\tilde{a}_{\text{in}}]\) etc.
Analytic Cavity Output
Takes \(\hat{a}_{\text{out}}, \hat{a}_{\text{out}}^\dagger\) from
output_light_noise_vectorsand reverses the input-output relations (this is obviously pointlessly convoluted but it should still work!)
LAM (but not Hybrid, nor TNT)
Takes the relevant \(\hat{a}, \hat{a}^\dagger\) entries from
c_noise_vectori.e. \(\hat{\mathbf{c}} = \mathbf{T} \cdot \hat{\mathbf{c}}_{\text{in}}\)
ALL OTHER METHODS: (Hybrid LAM, Numerical H and Power Series H)
Calculate \(\hat{a} = \chi_{\text{c}}(\omega)[i \sum_{j_n} G_{j_n} \hat{q}_{j_n} + \sqrt{\kappa} \tilde{a}_{\text{in}}]\)
\(G_{j_n} \equiv g_{j_n} e^{i\phi_n}\) etc.
(5) output_light_noise_vectors¶
Returns: \(\Rightarrow\) 2-tuple of \((2N + 2,)\)-shaped numpy.ndarrays: noise vectors of the annihilation and creation operators \(\hat{a}_{\text{out}}, \hat{a}^\dagger_{\text{out}}\) of the output cavity light
Analytic Cavity Output
Takes the input-output relations \(\hat{a}_{\text{out}} = -\sqrt{\kappa}\hat{a} + \tilde{a}_{\text{in}}\) etc.
Inserts first \(\hat{a} = \chi_{\text{c}}(\omega)[i\bar{g}\mathrm{\hat{Q}}_\phi + \ldots]\) etc.
Then \(\mathrm{\hat{Q}}_\phi = \mathbb{M}_{\text{TOT}}^{-1}[\mathbb{F}_a \tilde{a}_{\text{in}} + \ldots]\) etc.
Gives \(\hat{a}_{\text{out}}\) in terms of \(\mathbb{M}_{\text{TOT}}, \mathbb{F}_a,\ldots\) etc.
ALL OTHER METHODS: (all LAM, both hybridisation, & analytic inside cavity)
take \(\hat{a}, \hat{a}^\dagger\) from
light_noise_vectorsand applies the input-output relations
(6) all_position_power_spectra (not a function of \(\omega\))¶
Returns: \(\Rightarrow\) (psd_array, psd_dict)
psd_arrayis a \((F, N)\)-shapednumpy.ndarraywith all the PSD values for each dimension’s position at each frequency valuepsd_dictis a \(N\)-lengtheddictwith each entry’s key being the dimension labelstr, and each value being a \((F,)\)-shapednumpy.ndarrayof its position operator values at each frequencyTNT LAM
Calculates
psd_arraydirectly via “matrix of all spectra” \(S_{\mathbf{c}\mathbf{c}^\dagger} \equiv \mathbf{T}\mathbf{N}\mathbf{T}^\dagger\)\(\mathbf{N} = \mathrm{diag}(\kappa(n_{\text{c}} + 1), \ \kappa n_{\text{c}}, \ \ldots, \Gamma_{j_n}(n_{j_n} + 1), \Gamma_{j_n} n_{j_n}, \ldots)\) is the “noise” matrix
\(n_{\text{c}} \equiv\) number of noise photons (\(n_{\text{c}} = 0\) for shot noise)
\(n_{j_n} \equiv\) number of phonons for \(j_n\) dimension via Bose-Einstein statistics
ALL OTHER METHODS: (LAM, Hybrid LAM, both hybridisation, and both analytic)
Loops over
ω_rangeand, at each \(\omega\), builds the whole \((N, 2N + 2)\)hybridised_positionsarray, then reduces each dimension’s row to one PSD value withnoise_vector_to_power_spectrumi.e. \(S_{q_{j_n}q_{j_n}}(\omega) = \sum_{\text{noises}} \eta_{\text{noise}} \ \big|\hat{q}_{j_n}[\text{noise}]\big|^2\)
\(\eta_{\text{noise}} \equiv\)
quantum_factor_per_noise_operator, the occupation factors \((n_{\text{c}} + 1, \ n_{\text{c}}, \ \ldots, n_{j_n} + 1, \ n_{j_n}, \ldots)\)the rates \(\kappa\) and \(\Gamma_{j_n}\) do not appear here: they are already inside the noise vectors, via the \(\sqrt{\kappa}\tilde{a}_\text{in}\) and \(\sqrt{\Gamma_{j_n}}\tilde{\mathrm{Q}}_{\text{THERM}}\) prefactors. This is the one place the TNT route differs in form, since it carries them explicitly in \(\mathbf{N}\)
This is why TNT is the only method that can fill
psd_arraywithout ever constructing a noise vector, and equally why it is the only method that cannot give a single position on its own
Note on
zpf_scaled\(\hat{q}_{j_n}\) is dimensionless throughout (in units of the zero-point fluctuation), so
zpf_scaled=Truereturns the PSD as calculatedzpf_scaled=Falsemultiplies each dimension’s PSD by \(x_{\text{zpf}, j_n}^2\) to put it back into \(\text{m}^2/\text{Hz}\) (a two-sided density in \(\omega\) normalised as \(\int S\,d\omega/2\pi = \langle \hat x^2 \rangle\); see Conventions)