Full API

Autogenerated API list

Gabs.GaussianChannelType

Defines a Gaussian channel for an N-mode bosonic system over a 2N-dimensional phase space.

Fields

  • basis: Symplectic representation for Gaussian channel.
  • disp: The displacement vector of length 2N.
  • transform: The transformation matrix of size 2N x 2N.
  • noise: The noise matrix of size 2N x 2N.
  • ħ = 2: Reduced Planck's constant.

Mathematical description of a Gaussian channel

An N-mode Gaussian channel is an operator characterized by a displacement vector d of length 2N, as well as a transformation matrix T and noise matrix N of size 2N x 2N, such that its action on a Gaussian state results in a Gaussian state. More specifically, a Gaussian channel action on a Gaussian state is described by its maps on the statistical moments and V of the Gaussian state: x̄ → Tx̄ + d and V → TVTᵀ + N.

Example

julia> noise = [1.0 -3.0; 4.0 2.0];

julia> displace(QuadPairBasis(1), 1.0+im, noise)
GaussianChannel for 1 mode.
  symplectic basis: QuadPairBasis
displacement: 2-element Vector{Float64}:
 2.0
 2.0
transform: 2×2 Matrix{Float64}:
 1.0  0.0
 0.0  1.0
noise: 2×2 Matrix{Float64}:
 1.0  -3.0
 4.0   2.0
source
Gabs.GaussianStateType

Defines a Gaussian state for an N-mode bosonic system over a 2N-dimensional phase space.

Fields

  • basis: Symplectic basis for Gaussian state.
  • mean: The mean vector of length 2N.
  • covar: The covariance matrix of size 2N x 2N.
  • ħ = 2: Reduced Planck's constant.

Example

julia> coherentstate(QuadPairBasis(1), 1.0+im)
GaussianState for 1 mode.
  symplectic basis: QuadPairBasis
mean: 2-element Vector{Float64}:
 2.0
 2.0
covariance: 2×2 Matrix{Float64}:
 1.0  0.0
 0.0  1.0
source
Gabs.GaussianUnitaryType

Defines a Gaussian unitary for an N-mode bosonic system over a 2N-dimensional phase space.

Fields

  • basis: Symplectic basis for Gaussian unitary.
  • disp: The displacement vector of length 2N.
  • symplectic: The symplectic matrix of size 2N x 2N.
  • ħ = 2: Reduced Planck's constant.

Mathematical description of a Gaussian unitary

An N-mode Gaussian unitary, is a unitary operator characterized by a displacement vector d of length 2N and symplectic matrix S of size 2N x 2N, such that its action on a Gaussian state results in a Gaussian state. More specifically, a Gaussian unitary transformation on a Gaussian state is described by its maps on the statistical moments and V of the Gaussian state: x̄ → Sx̄ + d and V → SVSᵀ.

Example

julia> displace(QuadPairBasis(1), 1.0+im)
GaussianUnitary for 1 mode.
  symplectic basis: QuadPairBasis
displacement: 2-element Vector{Float64}:
 2.0
 2.0
symplectic: 2×2 Matrix{Float64}:
 1.0  0.0
 0.0  1.0
source
Gabs.QuadBlockBasisType

Defines a symplectic basis for a bosonic system of size nmodes in which the quadrature field operators are arranged blockwise.

source
Gabs.QuadPairBasisType

Defines a symplectic basis for a bosonic system of size nmodes in which the quadrature field operators are arranged pairwise.

source
Gabs.amplifierMethod
amplifier([Td=Vector{Float64}, Tt=Matrix{Float64},] basis::SymplecticBasis, r<:Real, n<:Int)

Gaussian channel describing the interaction of an input single mode Gaussian state and its environment via a two-mode squeezing operation. The channel is paramatrized by squeezing amplitude parameter r and thermal noise n.

Mathematical description of an amplifier channel

An amplifier channel, A(r, nₜₕ), where r is the squeezing amplitude parameter and nₜₕ ≥ 1 is the thermal noise parameter, is characterized by the zero displacement vector, transformation matrix cosh(r)I, and noise matrix nₜₕsinh²(r)I.

Example

julia> amplifier(QuadPairBasis(1), 2.0, 3)
GaussianChannel for 1 mode.
  symplectic basis: QuadPairBasis
displacement: 2-element Vector{Float64}:
 0.0
 0.0
transform: 2×2 Matrix{Float64}:
 3.7622  0.0
 0.0     3.7622
noise: 2×2 Matrix{Float64}:
 39.4623   0.0
  0.0     39.4623
source
Gabs.attenuatorMethod
attenuator([Td=Vector{Float64}, Tt=Matrix{Float64},] basis::SymplecticBasis, theta<:Real, n<:Int)

Gaussian channel describing the coupling of an input single mode Gaussian state and its environment via a beam splitter operation. The channel is paramatrized by beam splitter rotation angle theta and thermal noise n.

Mathematical description of an attenuator channel

An attenuator channel, E(θ, nₜₕ), where θ is the beam splitter rotation parameter and nₜₕ ≥ 1 is the thermal noise parameter, is characterized by the zero displacement vector, transformation matrix cos(θ)I, and noise matrix nₜₕsin²(θ)I.

Example

julia> attenuator(QuadPairBasis(1), pi/6, 3)
GaussianChannel for 1 mode.
  symplectic basis: QuadPairBasis
displacement: 2-element Vector{Float64}:
 0.0
 0.0
transform: 2×2 Matrix{Float64}:
 0.866025  0.0
 0.0       0.866025
noise: 2×2 Matrix{Float64}:
 0.75  0.0
 0.0   0.75
source
Gabs.beamsplitterMethod
beamsplitter([Tm=Vector{Float64}, Ts=Matrix{Float64}], basis::SymplecticBasis, transmit<:Real)
beamsplitter([Tm=Vector{Float64}, Ts=Matrix{Float64}], basis::SymplecticBasis, transmit<:Real, noise::Ts)

Gaussian operator that serves as the beam splitter transformation of a two-mode Gaussian state, known as the beam splitter operator. The symplectic representation is given by basis. The transmittivity of the operator is given by transmit. Noise can be added to the operation with noise.

Mathematical description of a beam splitter operator

A beam splitter operator B(τ) is defined by the operation B(τ) = exp(θ(âᵗb̂ - âb̂ᵗ)), where θ is defined by τ = cos²θ, and and are the annihilation operators of the two modes, respectively. The operator B(τ) is characterized by the zero displacement vector and symplectic matrix [√τI √(1-τ)I; -√(1-τ)I √τI].

Example

julia> beamsplitter(QuadPairBasis(2), 0.75)
GaussianUnitary for 2 modes.
  symplectic basis: QuadPairBasis
displacement: 4-element Vector{Float64}:
 0.0
 0.0
 0.0
 0.0
symplectic: 4×4 Matrix{Float64}:
  0.5        0.0       0.866025  0.0
  0.0        0.5       0.0       0.866025
 -0.866025   0.0       0.5       0.0
  0.0       -0.866025  0.0       0.5
source
Gabs.changebasisMethod
changebasis(::SymplecticBasis, state::GaussianChannel)

Change the symplectic basis of a Gaussian channel.

Example

julia> ch = attenuator(QuadBlockBasis(2), [1.0, 2.0], [2, 4])
GaussianChannel for 2 modes.
  symplectic basis: QuadBlockBasis
displacement: 4-element Vector{Float64}:
 0.0
 0.0
 0.0
 0.0
transform: 4×4 Matrix{Float64}:
 0.540302   0.0       0.0        0.0
 0.0       -0.416147  0.0        0.0
 0.0        0.0       0.540302   0.0
 0.0        0.0       0.0       -0.416147
noise: 4×4 Matrix{Float64}:
 1.41615  0.0      0.0      0.0
 0.0      3.30729  0.0      0.0
 0.0      0.0      1.41615  0.0
 0.0      0.0      0.0      3.30729

julia> changebasis(QuadPairBasis, ch)
GaussianChannel for 2 modes.
  symplectic basis: QuadPairBasis
displacement: 4-element Vector{Float64}:
 0.0
 0.0
 0.0
 0.0
transform: 4×4 Matrix{Float64}:
 0.540302  0.0        0.0        0.0
 0.0       0.540302   0.0        0.0
 0.0       0.0       -0.416147   0.0
 0.0       0.0        0.0       -0.416147
noise: 4×4 Matrix{Float64}:
 1.41615  0.0      0.0      0.0
 0.0      1.41615  0.0      0.0
 0.0      0.0      3.30729  0.0
 0.0      0.0      0.0      3.30729
source
Gabs.changebasisMethod
changebasis(::SymplecticBasis, state::GaussianUnitary)

Change the symplectic basis of a Gaussian unitary.

Example

julia> op = displace(QuadBlockBasis(2), 1.0-im)
GaussianUnitary for 2 modes.
  symplectic basis: QuadBlockBasis
displacement: 4-element Vector{Float64}:
  2.0
  2.0
 -2.0
 -2.0
symplectic: 4×4 Matrix{Float64}:
 1.0  0.0  0.0  0.0
 0.0  1.0  0.0  0.0
 0.0  0.0  1.0  0.0
 0.0  0.0  0.0  1.0

julia> changebasis(QuadPairBasis, op)
GaussianUnitary for 2 modes.
  symplectic basis: QuadPairBasis
displacement: 4-element Vector{Float64}:
  2.0
 -2.0
  2.0
 -2.0
symplectic: 4×4 Matrix{Float64}:
 1.0  0.0  0.0  0.0
 0.0  1.0  0.0  0.0
 0.0  0.0  1.0  0.0
 0.0  0.0  0.0  1.0
source
Gabs.changebasisMethod
changebasis(::SymplecticBasis, state::GaussianState)

Change the symplectic basis of a Gaussian state.

Example

julia> st = squeezedstate(QuadBlockBasis(2), 1.0, 2.0)
GaussianState for 2 modes.
  symplectic basis: QuadBlockBasis
mean: 4-element Vector{Float64}:
 0.0
 0.0
 0.0
 0.0
covariance: 4×4 Matrix{Float64}:
  5.2715    0.0      -3.29789   0.0
  0.0       5.2715    0.0      -3.29789
 -3.29789   0.0       2.25289   0.0
  0.0      -3.29789   0.0       2.25289

julia> changebasis(QuadPairBasis, st)
GaussianState for 2 modes.
  symplectic basis: QuadPairBasis
mean: 4-element Vector{Float64}:
 0.0
 0.0
 0.0
 0.0
covariance: 4×4 Matrix{Float64}:
  5.2715   -3.29789   0.0       0.0
 -3.29789   2.25289   0.0       0.0
  0.0       0.0       5.2715   -3.29789
  0.0       0.0      -3.29789   2.25289
source
Gabs.coherentstateMethod
coherentstate([Tm=Vector{Float64}, Tc=Matrix{Float64},] basis::SymplecticBasis, alpha<:Number)

Gaussian state that is the quantum analogue of a monochromatic electromagnetic field, known as the coherent state. The symplectic representation is defined by basis. The complex amplitude of the state is given by alpha.

Mathematical description of a coherent state

A coherent state |α⟩, where α is the complex amplitude, is characterized by the mean vector √2ħ [real(α), imag(α)] and covariance matrix (ħ/2)I.

Example

julia> coherentstate(QuadPairBasis(1), 1.0+im)
GaussianState for 1 mode.
  symplectic basis: QuadPairBasis
mean: 2-element Vector{Float64}:
 2.0
 2.0
covariance: 2×2 Matrix{Float64}:
 1.0  0.0
 0.0  1.0
source
Gabs.displaceMethod
displace([Tm=Vector{Float64}, Ts=Matrix{Float64}], basis::SymplecticBasis, alpha<:Number)
displace([Tm=Vector{Float64}, Ts=Matrix{Float64}], basis::SymplecticBasis, alpha<:Number, noise::Ts)

Gaussian operator that displaces the vacuum state into a coherent state, known as the displacement operator. The symplectic representation is given by basis. The complex amplitude is given by alpha. Noise can be added to the operation with noise.

Mathematical description of a displacement operator

A displacement operator D(α) is defined by the operation D(α)|0⟩ = |α⟩, where α is a complex amplitude. The operator D(α) is characterized by the displacement vector √2ħ [real(α), imag(α)] and symplectic matrix I.

Example

julia> displace(QuadPairBasis(1), 1.0+im)
GaussianUnitary for 1 mode.
  symplectic basis: QuadPairBasis
displacement: 2-element Vector{Float64}:
 2.0
 2.0
symplectic: 2×2 Matrix{Float64}:
 1.0  0.0
 0.0  1.0
source
Gabs.eprstateMethod
eprstate([Tm=Vector{Float64}, Tc=Matrix{Float64},] basis::SymplecticBasis, r<:Real, theta<:Real)

Gaussian state that is a two-mode squeezed state, known as the Einstein-Podolski-Rosen (EPR) state. The symplectic representation is defined by basis. The amplitude and phase squeezing parameters are given by r and theta, respectively.

Mathematical description of an EPR state

An EPR state |r, θ⟩ₑₚᵣ, where r is the amplitude squeezing parameter and θ is the phase squeezing parameter, is characterized by the zero mean vector and covariance matrix (ħ/2)[cosh(2r)I -sinh(2r)R(θ); -sinh(2r)R(θ) cosh(2r)I], where R(θ) is the rotation matrix.

Example

julia> eprstate(QuadPairBasis(2), 0.5, pi/4)
GaussianState for 2 modes.
  symplectic basis: QuadPairBasis
mean: 4-element Vector{Float64}:
 0.0
 0.0
 0.0
 0.0
covariance: 4×4 Matrix{Float64}:
  1.54308    0.0       -0.830993  -0.830993
  0.0        1.54308   -0.830993   0.830993
 -0.830993  -0.830993   1.54308    0.0
 -0.830993   0.830993   0.0        1.54308
source
Gabs.generaldyneMethod
generaldyne(state::GaussianState, indices::Vector; proj = (ħ/2)I) -> Generaldyne
generaldyne(state::GaussianState, index::Int; proj = (ħ/2)I) -> Generaldyne

Compute the projection of the subsystem of a Gaussian state state indicated by indices on proj and return a Generaldyne object. The keyword argument proj can take the following forms:

  • If proj is a matrix, then the subsystem is projected onto a Gaussian state with a randomly sampled mean and covariance matrix result.
  • If proj is a Gaussian state, then the subsystem is projected onto proj.

The result and mapped state output can be obtained from the Generaldyne object M via M.result and M.output. Iterating the decomposition produces the components result and output.

Note the measured modes are replaced with vacuum states after the general-dyne measurement.

Examples

julia> st = squeezedstate(QuadBlockBasis(3), 1.0, pi/4);

julia> M = generaldyne(st, [1, 3])
Generaldyne{GaussianState{QuadBlockBasis{Int64}, Vector{Float64}, Matrix{Float64}}, GaussianState{QuadBlockBasis{Int64}, Vector{Float64}, Matrix{Float64}}}
result:
GaussianState for 2 modes.
  symplectic basis: QuadBlockBasis
mean: 4-element Vector{Float64}:
  0.26967410461090285
  1.4683993027500133
 -1.84631450059537
  0.16832788926417352
covariance: 4×4 Matrix{Float64}:
 1.0  0.0  0.0  0.0
 0.0  1.0  0.0  0.0
 0.0  0.0  1.0  0.0
 0.0  0.0  0.0  1.0
output state:
GaussianState for 3 modes.
  symplectic basis: QuadBlockBasis
mean: 6-element Vector{Float64}:
 0.0
 0.0
 0.0
 0.0
 0.0
 0.0
covariance: 6×6 Matrix{Float64}:
 1.0   0.0      0.0  0.0   0.0      0.0
 0.0   1.19762  0.0  0.0  -2.56458  0.0
 0.0   0.0      1.0  0.0   0.0      0.0
 0.0   0.0      0.0  1.0   0.0      0.0
 0.0  -2.56458  0.0  0.0   6.32677  0.0
 0.0   0.0      0.0  0.0   0.0      1.0

julia> result, state = M; # destructuring via iteration

julia> result == M.result && state == M.state
true
source
Gabs.isgaussianMethod
isgaussian(x::GaussianState)
isgaussian(x::GaussianUnitary)
isgaussian(x::GaussianChannel)

Check if x satisfies the corresponding Gaussian definition for its type.

Example

julia> basis = QuadPairBasis(1);

julia> op = displace(basis, 1.0-im)
GaussianUnitary for 1 mode.
  symplectic basis: QuadPairBasis
displacement: 2-element Vector{Float64}:
  2.0
 -2.0
symplectic: 2×2 Matrix{Float64}:
 1.0  0.0
 0.0  1.0

julia> isgaussian(op)
true
source
Gabs.phaseshiftMethod
phaseshift([Tm=Vector{Float64}, Ts=Matrix{Float64}], basis::SymplecticBasis, theta<:Real)
phaseshift([Tm=Vector{Float64}, Ts=Matrix{Float64}], basis::SymplecticBasis, theta<:Real, noise::Ts)

Gaussian operator that rotates the phase of a given Gaussian mode by theta, as the phase shift operator. The symplectic representation is given by basis. Noise can be added to the operation with noise.

Mathematical description of a phase shift operator

A phase shift operator is defined by the operation U(θ) = exp(-iθâᵗâ), where θ is the phase parameter, and âᵗ and are the raising and lowering operators, respectively. The operator U(θ) is characterized by the zero displacement vector and symplectic matrix [cos(θ) sin(θ); -sin(θ) cos(θ)].

Example

julia> phaseshift(QuadPairBasis(1), 3pi/4)
GaussianUnitary for 1 mode.
  symplectic basis: QuadPairBasis
displacement: 2-element Vector{Float64}:
 0.0
 0.0
symplectic: 2×2 Matrix{Float64}:
 -0.707107   0.707107
 -0.707107  -0.707107
source
Gabs.ptraceMethod
ptrace([Tm=Vector{Float64}, Tc=Matrix{Float64},] state::GaussianState, idx<:Int)
ptrace([Tm=Vector{Float64}, Tc=Matrix{Float64},] state::GaussianState, indices<:AbstractVector)

Partial trace of a Gaussian state over a subsystem indicated by idx, or multiple subsystems indicated by indices.

Example

julia> basis = QuadPairBasis(1);

julia> state = coherentstate(basis, 1.0+im) ⊗ thermalstate(basis, 2) ⊗ squeezedstate(basis, 3.0, pi/4);

julia> ptrace(state, 2)
GaussianState for 2 modes.
  symplectic basis: QuadPairBasis
mean: 4-element Vector{Float64}:
 2.0
 2.0
 0.0
 0.0
covariance: 4×4 Matrix{Float64}:
 1.0  0.0     0.0        0.0
 0.0  1.0     0.0        0.0
 0.0  0.0    59.0829  -142.633
 0.0  0.0  -142.633    344.348

julia> ptrace(state, [1, 3])
GaussianState for 1 mode.
  symplectic basis: QuadPairBasis
mean: 2-element Vector{Float64}:
 0.0
 0.0
covariance: 2×2 Matrix{Float64}:
 5.0  0.0
 0.0  5.0
source
Gabs.purityMethod
purity(state::GaussianState)

Calculate the purity of a Gaussian state, defined by 1/sqrt((2/ħ) det(V)).

source
Gabs.randchannelMethod
randchannel([Td=Vector{Float64}, Tt=Matrix{Float64},] basis::SymplecticBasis)

Calculate a random Gaussian channel in symplectic representation defined by basis.

source
Gabs.randstateMethod
randstate([Tm=Vector{Float64}, Tc=Matrix{Float64},] basis::SymplecticBasis; pure=false)

Calculate a random Gaussian state in symplectic representation defined by basis.

source
Gabs.randunitaryMethod
randunitary([Td=Vector{Float64}, Ts=Matrix{Float64},] basis::SymplecticBasis; passive=false)

Calculate a random Gaussian unitary operator in symplectic representation defined by basis.

source
Gabs.squeezeMethod
squeeze([Tm=Vector{Float64}, Ts=Matrix{Float64}], basis::SymplecticBasis, r<:Real, theta<:Real)
squeeze([Tm=Vector{Float64}, Ts=Matrix{Float64}], basis::SymplecticBasis, r<:Real, theta<:Real, noise::Ts)

Gaussian operator that squeezes the vacuum state into a squeezed state, known as the squeezing operator. The symplectic representation is given by basis. The amplitude and phase squeezing parameters are given by r and theta, respectively. Noise can be added to the operation with noise.

Mathematical description of a squeezing operator

A squeeze operator S(r, θ) is defined by the operation S(r, θ)|0⟩ = |r, θ⟩, where r and θ are the real amplitude and phase parameters, respectively. The operator S(r, θ) is characterized by the zero displacement vector and symplectic matrix cosh(r)I - sinh(r)R(θ), where R(θ) is the rotation matrix.

Example

julia> squeeze(QuadPairBasis(1), 0.25, pi/4)
GaussianUnitary for 1 mode.
  symplectic basis: QuadPairBasis
displacement: 2-element Vector{Float64}:
 0.0
 0.0
symplectic: 2×2 Matrix{Float64}:
  0.852789  -0.178624
 -0.178624   1.21004
source
Gabs.squeezedstateMethod
squeezedstate([Tm=Vector{Float64}, Tc=Matrix{Float64},] basis::SymplecticBasis, r<:Real, theta<:Real)

Gaussian state with quantum uncertainty in its phase and amplitude, known as the squeezed state. The symplectic representation is defined by basis. The amplitude and phase squeezing parameters are given by r and theta, respectively.

Mathematical description of a squeezed state

A squeezed state |r, θ⟩, where r is the amplitude squeezing parameter and θ is the phase squeezing parameter, is characterized by the zero mean vector and covariance matrix (ħ/2) (cosh(2r)I - sinh(2r)R(θ)), where R(θ) is the rotation matrix.

Example

julia> squeezedstate(QuadPairBasis(1), 0.5, pi/4)
GaussianState for 1 mode.
  symplectic basis: QuadPairBasis
mean: 2-element Vector{Float64}:
 0.0
 0.0
covariance: 2×2 Matrix{Float64}:
  0.712088  -0.830993
 -0.830993   2.37407
source
Gabs.sympspectrumMethod
sympspectrum(state::GaussianState)

Compute the symplectic spectrum of a Gaussian state.

source
Gabs.thermalstateMethod
thermalstate([Tm=Vector{Float64}, Tc=Matrix{Float64},] basis::SymplecticBasis, photons<:Int)

Gaussian state at thermal equilibrium, known as the thermal state. The symplectic representation is defined by basis. The mean photon number of the state is given by photons.

Mathematical description of a thermal state

A thermal state |n̄⟩, where is the mean number of photons, is characterized by the zero mean vector and covariance matrix ħ(n̄+1/2)I.

Example

julia> thermalstate(QuadPairBasis(1), 4)
GaussianState for 1 mode.
  symplectic basis: QuadPairBasis
mean: 2-element Vector{Float64}:
 0.0
 0.0
covariance: 2×2 Matrix{Float64}:
 9.0  0.0
 0.0  9.0
source
Gabs.twosqueezeMethod
twosqueeze([Tm=Vector{Float64}, Ts=Matrix{Float64}], basis::SymplecticBasis, r<:Real, theta<:Real)
twosqueeze([Tm=Vector{Float64}, Ts=Matrix{Float64}], basis::SymplecticBasis, r<:Real, theta<:Real, noise::Ts)

Gaussian operator that squeezes a two-mode vacuum state into a two-mode squeezed state, known as the two-mode squeezing operator. The symplectic representation is given by basis. The amplitude and phase squeezing parameters are given by r and theta, respectively. Noise can be added to the operation with noise.

Mathematical description of a two-mode squeezing operator

A two-mode squeeze operator S₂(r, θ) is defined by the operation S₂(r, θ)|0⟩ = |r, θ⟩, where r and θ are the real amplitude and phase parameters, respectively. The operator S₂(r, θ) is characterized by the zero displacement vector and symplectic matrix [cosh(r)I -sinh(r)R(θ); -sinh(r)R(θ) cosh(r)I], where R(θ) is the rotation matrix.

Example

julia> twosqueeze(QuadPairBasis(2), 0.25, pi/4)
GaussianUnitary for 2 modes.
  symplectic basis: QuadPairBasis
displacement: 4-element Vector{Float64}:
 0.0
 0.0
 0.0
 0.0
symplectic: 4×4 Matrix{Float64}:
  1.03141    0.0       -0.178624  -0.178624
  0.0        1.03141   -0.178624   0.178624
 -0.178624  -0.178624   1.03141    0.0
 -0.178624   0.178624   0.0        1.03141
source
Gabs.vacuumstateMethod
vacuumstate([Tm=Vector{Float64}, Tc=Matrix{Float64}], basis::SymplecticBasis)

Gaussian state with zero photons, known as the vacuum state. The symplectic representation is defined by basis.

Mathematical description of a vacuum state

A vacuum state |0⟩ is characterized by the zero mean vector and covariance matrix (ħ/2)I.

Example

julia> vacuumstate(QuadPairBasis(1))
GaussianState for 1 mode.
  symplectic basis: QuadPairBasis
mean: 2-element Vector{Float64}:
 0.0
 0.0
covariance: 2×2 Matrix{Float64}:
 1.0  0.0
 0.0  1.0
source
Gabs.wignerMethod
wigner(state::GaussianState, x)

Compute the Wigner function of an N-mode Gaussian state at x, a vector of size 2N.

source
Gabs.wignercharMethod
wignerchar(state::GaussianState, xi)

Compute the Wigner characteristic function of an N-mode Gaussian state at xi, a vector of size 2N.

source
QuantumInterface.apply!Method
apply!(state::GaussianState, op::GaussianChannel)

In-place application of a Gaussian channel op on a Gaussian state state.

source
QuantumInterface.apply!Method
apply!(state::GaussianState, op::GaussianUnitary)

In-place application of a Gaussian unitary op on a Gaussian state state.

source
QuantumInterface.entropy_vnMethod
entropy_vn(state::GaussianState; tol::Real = 128 * eps(1/2))

Calculate the Von Neumann entropy of a Gaussian state, defined as

\[S(\rho) = -Tr(\rho \log(\rho)) = \sum_i f(v_i)\]

such that $\log$ denotes the natural logarithm, $v_i$ is the symplectic spectrum of $\mathbf{V}/\hbar$, and the $f$ is taken to be

\[f(x) = (x + 1/2) \log(x + 1/2) - (x - 1/2) \log(x - 1/2)\]

wherein it is understood that $0 \log(0) \equiv 0$.

Arguments

  • state: Gaussian state whose Von Neumann entropy is to be calculated.
  • tol: Tolerance (exclusive) above the cut-off at $1/2$ for computing $f(x)$.
source
QuantumInterface.fidelityMethod
fidelity(state1::GaussianState, state2::GaussianState; tol::Real = 128 * eps(1))

Calculate the joint fidelity of two Gaussian states, defined as

\[F(\rho, \sigma) = Tr(\sqrt{\sqrt{\rho} \sigma \sqrt{\rho}}).\]

See: Banchi, Braunstein, and Pirandola, Phys. Rev. Lett. 115, 260501 (2015)

Arguments

  • state1, state2: Gaussian states whose joint fidelity is to be calculated.
  • tol: Tolerance (inclusive) above the cut-off at $1$ for computing $x + \sqrt{x^2 - 1}$.
source
QuantumInterface.logarithmic_negativityMethod
logarithmic_negativity(state::GaussianState, indices::Union{Integer, AbstractVector{<:Integer}}; tola::Real = 0, tolb::Real = 128 * eps(1))

Calculate the logarithmic negativity of a Gaussian state partition, defined as

\[N(\rho) = \log\|\rho^{T_B}\|_1 = - \sum_i \log(2 \tilde{v}_i^<)\]

such that $\log$ denotes the natural logarithm, $\tilde{v}_i^<$ is the symplectic spectrum of $\mathbf{\tilde{V}}/\hbar$ which is $< 1/2$.

Therein, $\mathbf{\tilde{V}} = \mathbf{T} \mathbf{V} \mathbf{T}$ where

\[\forall k : \mathbf{T} q_k = q_k \forall k \in \mathrm{B} : \mathbf{T} p_k = -p_k \forall k \notin \mathrm{B} : \mathbf{T} p_k = p_k\]

Arguments

  • state: Gaussian state whose logarithmic negativity is to be calculated.
  • indices: Integer or collection thereof, specifying the binary partition.
  • tola: Tolerance (inclusive) above the cut-off at $0$ for computing $\log(x)$.
  • tolb: Tolerance (inclusive) below the cut-off at $1$ for computing $\log(x)$.
source
QuantumInterface.tensorMethod
tensor(state1::GaussianState, state2::GaussianState)

tensor product of Gaussian states, which can also be called with .

Example

julia> basis = QuadPairBasis(1);

julia> coherentstate(basis, 1.0+im) ⊗ thermalstate(basis, 2)
GaussianState for 2 modes.
  symplectic basis: QuadPairBasis
mean: 4-element Vector{Float64}:
 2.0
 2.0
 0.0
 0.0
covariance: 4×4 Matrix{Float64}:
 1.0  0.0  0.0  0.0
 0.0  1.0  0.0  0.0
 0.0  0.0  5.0  0.0
 0.0  0.0  0.0  5.0
source
SymplecticFactorizations.blochmessiahMethod
blochmessiah(state::GaussianUnitary) -> BlochMessiah

Compute the Bloch-Messiah/Euler decomposition of the symplectic field of a GaussianUnitary and return a BlockMessiah object.

The orthogonal symplectic matrices O and Q as well as the singular values values can be obtained via F.O, F.Q, and F.values, respectively.

Iterating the decomposition produces the components O, values, and Q, in that order.

source
SymplecticFactorizations.issymplecticMethod
issymplectic(basis::SymplecticBasis, x::T)

Check if input matrix satisfies symplectic definition.

Example

julia> basis = QuadPairBasis(1);

julia> issymplectic(basis, [1.0 0.0; 0.0 1.0])
true
source
SymplecticFactorizations.polarMethod
polar(state::GaussianUnitary) -> Polar

Compute the Polar decomposition of the symplectic field of a GaussianUnitary object and return a Polar object.

O and P can be obtained from the factorization F via F.O and F.P, such that S = O * P. For the symplectic polar decomposition case, O is an orthogonal symplectic matrix and P is a positive-definite symmetric symplectic matrix.

Iterating the decomposition produces the components O and P.

source
SymplecticFactorizations.williamsonMethod
williamson(state::GaussianState) -> Williamson

Compute the williamson decomposition of the covar field of a GaussianState object and return a Williamson object.

A symplectic matrix S and symplectic spectrum spectrum can be obtained via F.S and F.spectrum.

Iterating the decomposition produces the components S and spectrum.

To compute only the symplectic spectrum of a Gaussian state, call sympspectrum.

source