levisim.analysis.gaussian_states¶
Gaussian states of bosonic modes, described by their covariance matrices
Everything here acts on covariance matrices (plain numpy arrays), so it applies equally to the mechanical modes of a MultiTrap, to its cavity mode, or to any other set of bosonic modes.
Conventions (the same as levisim’s light quadratures A = a† + a, P = i(a† - a)):
quadratures per mode X = b + b†, P = i(b† - b), so [X, P] = 2i
quadrature ordering u = (X1, P1, X2, P2, ...)
covariance matrix V_ij = ½〈{Δu_i, Δu_j}〉, so the vacuum is the identity matrix
uncertainty principle V + iΩ ≥ 0, i.e. every symplectic eigenvalue ν ≥ 1
logarithms natural, so a two-mode squeezed vacuum S(r)|0,0〉 has E_N = 2r
The entanglement measure used throughout levisim is the logarithmic negativity E_N, computed from the symplectic spectrum of the partially transposed covariance matrix. For two modes the positivity of the partial transpose (PPT) is necessary AND sufficient for separability of a Gaussian state (Simon, PRL 84, 2726 (2000)), so E_N > 0 if and only if the state is entangled. The other quantities here (Duan and Hillery-Zubairy witnesses, mutual information, discord, purity) are provided because they are often used in its place, and docs/two_tone_entanglement shows where each of them gives the wrong answer for levitated-particle states.
- levisim.analysis.gaussian_states.symplectic_form(num_modes)[source]¶
Ω = ⊕ [[0, 1], [-1, 0]], so that [u_i, u_j] = 2iΩ_ij
- levisim.analysis.gaussian_states.symplectic_eigenvalues(V)[source]¶
The symplectic eigenvalues ν_k of a covariance matrix, sorted in ascending order
They are the moduli of the eigenvalues of iΩV, which come in pairs ±ν_k. A physical state has every ν_k ≥ 1, with equality for every mode only if the state is pure.
- levisim.analysis.gaussian_states.is_physical(V, tolerance=1e-09)[source]¶
True if V is symmetric, positive definite and satisfies the uncertainty principle
- levisim.analysis.gaussian_states.reduced_covariance(V, modes)[source]¶
Covariance matrix of a subset of the modes (the partial trace of a Gaussian state)
- levisim.analysis.gaussian_states.partial_transpose(V, modes=(0,))[source]¶
Covariance matrix after partial transposition of the given modes
Transposition is time reversal, P → -P, on the transposed modes only.
- levisim.analysis.gaussian_states.partially_transposed_symplectic_eigenvalues(V, modes=(0,))[source]¶
Symplectic eigenvalues ν̃_k of the partially transposed covariance matrix
The state is PPT (and, for 1 × N mode bipartitions, separable) if and only if every ν̃_k ≥ 1.
- levisim.analysis.gaussian_states.log_negativity(V, modes=(0,))[source]¶
Logarithmic negativity E_N of the bipartition (modes | all other modes)
E_N = Σ_k max(0, -ln ν̃_k)
For two modes only the smallest ν̃_- can drop below 1, so E_N = max(0, -ln ν̃_-). It is an entanglement monotone (Plenio, PRL 95, 090503 (2005)), an upper bound on the distillable entanglement, additive, and invariant under local unitaries such as the free rotation of each mode at its own frequency. [·]
- levisim.analysis.gaussian_states.negativity(V, modes=(0,))[source]¶
Negativity N = (exp(E_N) - 1)/2, the absolute sum of the negative eigenvalues of ρ^{T_A} [·]
- levisim.analysis.gaussian_states.is_entangled(V, modes=(0,), tolerance=1e-12)[source]¶
PPT test: True if any partially transposed symplectic eigenvalue is below 1
- levisim.analysis.gaussian_states.mean_phonon_numbers(V)[source]¶
〈b_j†b_j〉 for each mode (zero mean assumed), including any local squeezing energy [·]
- levisim.analysis.gaussian_states.symplectic_occupations(V)[source]¶
Effective thermal occupation of each mode on its own, from 2n + 1 = √det(V_j)
This is the occupation that sets the purity of each reduced state, and is what Deplano et al., Nat. Commun. 16, 4215 (2025) quote as n_x, n_y. [·]
- levisim.analysis.gaussian_states.phonon_moments(V)[source]¶
Normally ordered second moments (N, M) with N_jk = 〈b_j†b_k〉 and M_jk = 〈b_j b_k〉
b_j = (X_j + iP_j)/2. The commutator [X_j, P_j] = 2i only contributes on the diagonal.
- levisim.analysis.gaussian_states.von_neumann_entropy(V)[source]¶
S(ρ) = Σ_k g(ν_k) over the symplectic eigenvalues [nats]
- levisim.analysis.gaussian_states.mutual_information(V, modes_A=(0,), modes_B=None)[source]¶
I(A:B) = S(A) + S(B) - S(AB)
Counts classical AND quantum correlations, so it is positive for separable states too. [nats]
- levisim.analysis.gaussian_states.gaussian_discord(V, measured_mode=1)[source]¶
Gaussian quantum discord of a two-mode state, for Gaussian measurements on measured_mode
Closed form of Adesso & Datta, PRL 105, 030501 (2010), written in the local symplectic invariants A = det α, B = det β, C = det γ, D = det V of V = [[α, γ], [γᵀ, β]], where β is the block of the measured mode. Discord is positive for almost every correlated state, separable ones included, so it does not witness entanglement (Ferraro et al., PRA 81, 052318 (2010)). It reproduces Deplano et al. (2025)’s published D_X|Y and D_Y|X. [nats]
- levisim.analysis.gaussian_states.local_rotation(V, angles)[source]¶
Rotates each mode’s quadratures by its angle θ_j, i.e. applies b_j → b_j·exp(-iθ_j)
This is free evolution for a time θ_j/Ω_j: X → X cos θ + P sin θ, P → P cos θ - X sin θ.
- levisim.analysis.gaussian_states.duan_criterion(V, θ1=0.0, θ2=0.0, a=1.0)[source]¶
Duan et al., PRL 84, 2722 (2000) inequality for one choice of local quadratures and weight
u = a·X1(θ1) + X2(θ2)/a, v = a·P1(θ1) - P2(θ2)/a Every separable state has Var(u) + Var(v) ≥ 2(a² + 1/a²) in these units.
Returns the ratio (Var u + Var v) / 2(a² + 1/a²); a value below 1 proves entanglement, but a value above 1 proves nothing, because the criterion is only sufficient. With fixed lab quadratures it misses entanglement whose correlations sit in rotated quadratures, which is always the case for the time-periodic states of a multi-tone drive. [·]
- levisim.analysis.gaussian_states.optimised_duan_criterion(V, num_starts=12, seed=0)[source]¶
Duan ratio minimised over both local rotations and the weight a
Still only a sufficient criterion: local squeezing is not optimised over, so it can miss entanglement that the PPT test (log_negativity) detects. Its verdict (ratio < 1) is exactly the Hillery-Zubairy one (hillery_zubairy_ratio > 1); see that docstring. Returns (ratio, θ1, θ2, a).
- levisim.analysis.gaussian_states.hillery_zubairy_ratio(V)[source]¶
|〈b1 b2〉|² / (〈b1†b1〉〈b2†b2〉), Hillery & Zubairy, PRL 96, 050503 (2006)A value above 1 proves entanglement; it is only sufficient, and blind to entanglement that is not carried by the pair correlation 〈b1 b2〉.
It is the same test as optimised_duan_criterion: with u = a·X1 + X2/a, v = a·P1 - P2/a, Var(u) + Var(v) = a²(4n1 + 2) + (4n2 + 2)/a² + 8·Re(〈b1 b2〉e^{-i(θ1 + θ2)}), which contains neither local squeezing nor the exchange correlation 〈b1†b2〉; minimising over the phases and over a gives Var(u) + Var(v) < 2(a² + 1/a²) exactly when
|〈b1 b2〉|² > n1·n2. [·]
- levisim.analysis.gaussian_states.common_phase_averaged(V, num_angles=16)[source]¶
Averages a two-mode state over a common, unknown phase: b_j → b_j·exp(-iθ) for both modes
This is what an observer without a phase reference sees, e.g. a time average of a state whose pair correlation 〈b1 b2〉 rotates at Ω1 + Ω2, or not knowing the relative phase of two drive tones. Pair (two-mode squeezing) correlations average to zero; exchange correlations 〈b1†b2〉 survive. The averaged state is not Gaussian; this returns its covariance matrix, whose PPT test is still a valid (second-moment) separability test for any state.
- levisim.analysis.gaussian_states.rotate_transverse_axes(V, Ω1, Ω2, φ)[source]¶
Covariance matrix of the motion along transverse axes rotated by φ from the principal axes
Mode 1 and mode 2 must be the motions of ONE particle along orthogonal principal axes with frequencies Ω1 and Ω2. Positions and momenta are rotated together (a point transformation), and each new axis is renormalised; local renormalisation does not change entanglement.
Because the two zero-point widths differ when Ω1 ≠ Ω2, the trap’s product ground state looks entangled along rotated axes - exactly E_N = ½|ln(Ω1/Ω2)| at 45° - so ‘x-y entanglement’ is only meaningful for a stated partition, normally the principal axes.