Reference
Gaussian states and operations
State definitions
With the following methods you can create some basic Gaussian states.
GaussianStates.vacuumstate — Functionvacuumstate([T = Float64, ]n)Return the vacuum Gaussian state of type T on n modes
GaussianStates.thermalstate — Functionthermalstate(n, β, ω::AbstractVector)Return the thermal state on n modes with inverse temperature β and frequency ω[k] for each mode k.
GaussianStates.randgaussianstate — Functionrandgaussianstate([T = Float64, ]n, λ; pure=false, displace=true)Generate a random n-mode Gaussian state with element type T, in the xpxp representation.
The state is generated from the Williamson decomposition, by drawing first the n symplectic eigenvalues $d_i$ and then applying a random symplectic transformation. Each $d_i$ is drawn from an exponential distribution with rate λ[i], which defaults to one (λ's elements must be convertible to T). If displace is true then a random displacement in $[-1, 1]$ is applied on each mode. The returned state is generally not pure, unless pure is false which forces the generation of a pure state.
Gaussian operations
The following methods can be applied to a GaussianState in order to simulate quantum optical operations.
GaussianStates.displace — Functiondisplace(g::GaussianState, α::AbstractVector)
displace(g::GaussianState, α, k)Variants of displace! that return a transformed copy of g leaving g itself unmodified.
GaussianStates.displace! — Functiondisplace!(g::GaussianState, α::AbstractVector)Transform the Gaussian state g by applying the displacement operator on all modes, with parameter α[k] on mode k.
displace!(g::GaussianState, α, k)Transform the Gaussian state g by applying the displacement operator on the k-th mode with parameter α.
GaussianStates.squeeze — Functionsqueeze(g::GaussianState, ζ::AbstractVector)
squeeze(g::GaussianState, ζ, k)Variants of squeeze! that return a transformed copy of g leaving g itself unmodified.
GaussianStates.squeeze! — Functionsqueeze!(g::GaussianState, ζ::AbstractVector)Transform the Gaussian state g by squeezing each mode k with parameter ζ[k], by applying the operator
\[S(ζ) = \exp\bigl(\tfrac12 ζ {\adj{a}}^2 - \tfrac12\conj{ζ} a^2\bigr)\]
on each mode.
With this definition, the squeezed vacuum state (on a single mode) is written in the eigenbasis of the number operator, with $ζ = r e^{iθ}$, as
\[\frac{1}{\sqrt{\cosh r}} \sum_{n=0}^{+∞} (e^{iθ} \tanh r)^n \frac{\sqrt{(2n)!}}{2^n n!} |2n⟩\]
squeeze!(g::GaussianState, ζ, k)Apply a squeezing transformation on the k-th mode with parameter ζ, by applying the operator
\[S(ζ) = \exp\bigl(\tfrac12 ζ {\adj{a}}^2 - \tfrac12\conj{ζ} a^2\bigr)\]
on the selected mode.
With this definition, the squeezed vacuum state (on a single mode) is written in the eigenbasis of the number operator, with $ζ = r e^{iθ}$, as
\[\frac{1}{\sqrt{\cosh r}} \sum_{n=0}^{+∞} (e^{iθ} \tanh r)^n \frac{\sqrt{(2n)!}}{2^n n!} |2n⟩\]
GaussianStates.squeeze2 — Functionsqueeze2(g::GaussianState, ζ, k1, k2)Variant of squeeze2! that returns a transformed copy of g leaving g itself unmodified.
GaussianStates.squeeze2! — Functionsqueeze2!(g::GaussianState, ζ, k1, k2)Apply a two-mode squeezing transformation on modes k1 and k2 with parameter ζ, by applying the operator
\[S_2(ζ) = \exp\bigl(ζ (\adj{a} ⊗ \adj{a}) - \conj{ζ} (a ⊗ a)\bigr)\]
on the selected modes.
With this definition, the two-mode squeezed vacuum state is written in the eigenbasis of the number operator, with $ζ = r e^{iθ}$, as
\[\frac{1}{\cosh r} \sum_{n=0}^{+∞} (e^{iθ} \tanh r)^n |n⟩ ⊗ |n⟩\]
GaussianStates.beamsplitter — Functionbeamsplitter(g::GaussianState, transmittivity, k1, k2)Variant of beamsplitter! that returns a transformed copy of g leaving g itself unmodified.
GaussianStates.beamsplitter! — Functionbeamsplitter!(g::GaussianState, η, k1, k2)Transform the Gaussian state g with a beam splitter on modes k1 and k2 with transmittivity η, represented by the operator
\[B(θ) = \exp\bigl(θ (a ⊗ \adj{a} - \adj{a} ⊗ a)\bigr)\]
with $η = \cos θ$.
GaussianStates.lossybeamsplitter — Functionlossybeamsplitter(g::GaussianState, transmittivity, loss, k1, k2)Variant of lossybeamsplitter! that returns a transformed copy of g leaving g itself unmodified.
GaussianStates.lossybeamsplitter! — Functionlossybeamsplitter!(g::GaussianState, transmittivity, loss, k1, k2)Transform the Gaussian state g with lossy a beam splitter on modes k1 and k2 with given transmittivity and loss parameters.
Matrix decompositions
GaussianStates.williamson — Functionwilliamson(M)Compute the Williamson decomposition of M, which is assumed to be a $2n × 2n$ real positive-definite matrix. Return D, V where V is a symplectic matrix, i.e. such that $V \sympmat \transpose{V} = \sympmat$ where
\[\sympmat = I_n ⊗ \begin{pmatrix} 0 & 1\\ -1 & 0 \end{pmatrix}\]
and D is a diagonal matrix of positive numbers, such that $V D \transpose{V} = M$.
GaussianStates.takagiautonne — Functiontakagiautonne(A; svd_order=true)Compute the Takagi-Autonne decomposition of the complex symmetric matrix A. Return D, U such that $A = U D \transpose{U}$, where D is a diagonal, positive-semidefinite matrix and U is unitary.
Set svd_order to true (the default) to return the result by ordering the diagonal values of D in descending order, false for ascending order.
GaussianStates.euler — Functioneuler(M)Compute the Euler, or Bloch-Messiah, decomposition of the symplectic matrix M. Return L, D, R such that $L D R = M$, where L and R are orthogonal symplectic matrices with respect to the matrix
\[\sympmat = I_n ⊗ \begin{pmatrix} 0 & 1\\ -1 & 0 \end{pmatrix}\]
and D is a diagonal matrix which can be written as
\[\begin{pmatrix} d_1 & 0\\ 0 & d_1^{-1} \end{pmatrix} ⊕ \begin{pmatrix} d_2 & 0\\ 0 & d_2^{-1} \end{pmatrix} ⊕ \dotsb ⊕ \begin{pmatrix} d_n & 0\\ 0 & d_n^{-1} \end{pmatrix}\]
with $d_j ≥ 1$.
Utilities
GaussianStates.nmodes — Functionnmodes(g::GaussianState)Return the number of modes g is defined on.
GaussianStates.randposdef — Functionrandposdef([T = Float64, ]n)Generate an $n × n$ real positive-definite matrix with element type T.
GaussianStates.randsymplectic — Functionrandsymplectic([T = Float64, ]n)Generate a random $2n × 2n$ real symplectic matrix of element type T such that $S \sympmat \transpose{S} = \sympmat$, with
\[\sympmat = I_n ⊗ \begin{pmatrix} 0 & 1\\ -1 & 0 \end{pmatrix}\]
GaussianStates.number — Functionnumber(g::GaussianState)Return the mean number of photons in the state g.
GaussianStates.purity — Functionpurity(g::GaussianState)Return the purity of the state g.
GaussianStates.is_valid_covariance_matrix — Functionis_valid_covariance_matrix(σ; atol, rtol)Test whether the matrix σ satisfies the conditions to be a covariance matrix for a Gaussian state, i.e. is a $2n × 2n$ symmetric matrix such that $σ > 0$ and $σ + i\sympmat ≥ 0$.
Keyword arguments are forwarded to isapprox to adjust the numerical thresholds of the inexact equality comparisons; atol defaults to eps(eltype(σ)) * norm(σ) when comparing with zero.
GaussianStates.issymplectic — Functionissymplectic(M)Check whether M is a symplectic matrix, i.e. if $M \sympmat \transpose{M} = \sympmat$ where
\[\sympmat = I_n ⊗ \begin{pmatrix} 0 & 1\\ -1 & 0 \end{pmatrix}\]