Reference

Gaussian states and operations

State definitions

With the following methods you can create some basic Gaussian states.

GaussianStates.thermalstateFunction
thermalstate(n, β, ω::AbstractVector)

Return the thermal state on n modes with inverse temperature β and frequency ω[k] for each mode k.

source
GaussianStates.randgaussianstateFunction
randgaussianstate([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.

source

Gaussian operations

The following methods can be applied to a GaussianState in order to simulate quantum optical operations.

GaussianStates.displaceFunction
displace(g::GaussianState, α::AbstractVector)
displace(g::GaussianState, α, k)

Variants of displace! that return a transformed copy of g leaving g itself unmodified.

source
GaussianStates.displace!Function
displace!(g::GaussianState, α::AbstractVector)

Transform the Gaussian state g by applying the displacement operator on all modes, with parameter α[k] on mode k.

source
displace!(g::GaussianState, α, k)

Transform the Gaussian state g by applying the displacement operator on the k-th mode with parameter α.

source
GaussianStates.squeezeFunction
squeeze(g::GaussianState, ζ::AbstractVector)
squeeze(g::GaussianState, ζ, k)

Variants of squeeze! that return a transformed copy of g leaving g itself unmodified.

source
GaussianStates.squeeze!Function
squeeze!(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⟩\]

source
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⟩\]

source
GaussianStates.squeeze2!Function
squeeze2!(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⟩\]

source
GaussianStates.beamsplitter!Function
beamsplitter!(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 θ$.

source
GaussianStates.lossybeamsplitter!Function
lossybeamsplitter!(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.

source

Matrix decompositions

GaussianStates.williamsonFunction
williamson(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$.

source
GaussianStates.takagiautonneFunction
takagiautonne(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.

source
GaussianStates.eulerFunction
euler(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$.

source

Utilities

GaussianStates.randsymplecticFunction
randsymplectic([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}\]

source
GaussianStates.is_valid_covariance_matrixFunction
is_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.

source
GaussianStates.issymplecticFunction
issymplectic(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}\]

source