Full API
Autogenerated API list
Gabs.GaussianChannel
— TypeDefines 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 x̄
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
Gabs.GaussianState
— TypeDefines 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
Gabs.GaussianUnitary
— TypeDefines 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 x̄
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
Gabs.QuadBlockBasis
— TypeDefines a symplectic basis for a bosonic system of size nmodes
in which the quadrature field operators are arranged blockwise.
Gabs.QuadPairBasis
— TypeDefines a symplectic basis for a bosonic system of size nmodes
in which the quadrature field operators are arranged pairwise.
Gabs.amplifier
— Methodamplifier([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
Gabs.attenuator
— Methodattenuator([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
Gabs.beamsplitter
— Methodbeamsplitter([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 b̂
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
Gabs.changebasis
— Methodchangebasis(::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
Gabs.changebasis
— Methodchangebasis(::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
Gabs.changebasis
— Methodchangebasis(::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
Gabs.coherentstate
— Methodcoherentstate([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
Gabs.displace
— Methoddisplace([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
Gabs.eprstate
— Methodeprstate([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
Gabs.generaldyne
— Methodgeneraldyne(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 matrixresult
. - If
proj
is a Gaussian state, then the subsystem is projected ontoproj
.
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
Gabs.isgaussian
— Methodisgaussian(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
Gabs.phaseshift
— Methodphaseshift([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
Gabs.ptrace
— Methodptrace([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
Gabs.purity
— Methodpurity(state::GaussianState)
Calculate the purity of a Gaussian state, defined by 1/sqrt((2/ħ) det(V))
.
Gabs.randchannel
— Methodrandchannel([Td=Vector{Float64}, Tt=Matrix{Float64},] basis::SymplecticBasis)
Calculate a random Gaussian channel in symplectic representation defined by basis
.
Gabs.randstate
— Methodrandstate([Tm=Vector{Float64}, Tc=Matrix{Float64},] basis::SymplecticBasis; pure=false)
Calculate a random Gaussian state in symplectic representation defined by basis
.
Gabs.randunitary
— Methodrandunitary([Td=Vector{Float64}, Ts=Matrix{Float64},] basis::SymplecticBasis; passive=false)
Calculate a random Gaussian unitary operator in symplectic representation defined by basis
.
Gabs.squeeze
— Methodsqueeze([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
Gabs.squeezedstate
— Methodsqueezedstate([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
Gabs.sympspectrum
— Methodsympspectrum(state::GaussianState)
Compute the symplectic spectrum of a Gaussian state.
Gabs.thermalstate
— Methodthermalstate([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 n̄
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
Gabs.twosqueeze
— Methodtwosqueeze([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
Gabs.vacuumstate
— Methodvacuumstate([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
Gabs.wigner
— Methodwigner(state::GaussianState, x)
Compute the Wigner function of an N-mode Gaussian state at x
, a vector of size 2N.
Gabs.wignerchar
— Methodwignerchar(state::GaussianState, xi)
Compute the Wigner characteristic function of an N-mode Gaussian state at xi
, a vector of size 2N.
QuantumInterface.apply!
— Methodapply!(state::GaussianState, op::GaussianChannel)
In-place application of a Gaussian channel op
on a Gaussian state state
.
QuantumInterface.apply!
— Methodapply!(state::GaussianState, op::GaussianUnitary)
In-place application of a Gaussian unitary op
on a Gaussian state state
.
QuantumInterface.directsum
— Methoddirectsum(basis1::SymplecticBasis, basis2::SymplecticBasis)
Compute the direct sum of symplectic bases.
QuantumInterface.entropy_vn
— Methodentropy_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)$.
QuantumInterface.fidelity
— Methodfidelity(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}$.
QuantumInterface.logarithmic_negativity
— Methodlogarithmic_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)$.
QuantumInterface.tensor
— Methodtensor(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
SymplecticFactorizations.blochmessiah
— Methodblochmessiah(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.
SymplecticFactorizations.issymplectic
— Methodissymplectic(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
SymplecticFactorizations.polar
— Methodpolar(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
.
SymplecticFactorizations.randsymplectic
— Methodrandsymplectic([T=Matrix{Float64},] basis::SymplecticBasis, passive=false)
Calculate a random symplectic matrix in symplectic representation defined by basis
.
SymplecticFactorizations.symplecticform
— Methodsymplecticform([T = Matrix{Float64},] basis::SymplecticBasis)
Compute the symplectic form matrix of size 2N x 2N corresponding to basis
.
SymplecticFactorizations.williamson
— Methodwilliamson(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
.