Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# News

## Unreleased

- Align `GaussianState`, `GaussianUnitary`, and `GaussianChannel` parameterization with QuantumInterface basis API.
- `GaussianState` now subtyped as `StateVector{B,V}` instead of `StateVector{M,V}`.
- `GaussianUnitary` and `GaussianChannel` now subtyped as `AbstractOperator{B,B}` instead of `AbstractOperator{D,T}` and `AbstractOperator{D,T}`.
- Added `basis_l` and `basis_r` fields to `GaussianUnitary` and `GaussianChannel` for QuantumInterface compatibility; these fields mirror the `basis` field.

## v1.3.4 - 2026-01-05

- Add optional rng arguments to random methods.
Expand Down
16 changes: 11 additions & 5 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ covariance: 2×2 Matrix{Float64}:
0.0 1.0
```
"""
@kwdef struct GaussianState{B<:SymplecticBasis,M,V} <: StateVector{M,V}
@kwdef struct GaussianState{B<:SymplecticBasis,M,V} <: StateVector{B,V}
basis::B
mean::M
covar::V
Expand Down Expand Up @@ -53,6 +53,7 @@ Defines a Gaussian unitary for an N-mode bosonic system over a 2N-dimensional ph
## Fields

- `basis`: Symplectic basis for Gaussian unitary.
- `basis_l`, `basis_r`: For QuantumInterface compatibility; always equal to `basis`.
- `disp`: The displacement vector of length 2N.
- `symplectic`: The symplectic matrix of size 2N x 2N.
- `ħ = 2`: Reduced Planck's constant.
Expand Down Expand Up @@ -80,14 +81,16 @@ symplectic: 2×2 Matrix{Float64}:
0.0 1.0
```
"""
@kwdef struct GaussianUnitary{B<:SymplecticBasis,D,S} <: AbstractOperator{D,S}
@kwdef struct GaussianUnitary{B<:SymplecticBasis,D,S} <: AbstractOperator{B,B}
basis::B
basis_l::B = basis
basis_r::B = basis
disp::D
symplectic::S
ħ::Number = 2
function GaussianUnitary(b::B, d::D, s::S; ħ::Number = 2) where {B,D,S}
all(size(s) .== length(d) .== 2*(b.nmodes)) || throw(DimensionMismatch(UNITARY_ERROR))
return new{B,D,S}(b, d, s, ħ)
return new{B,D,S}(b, b, b, d, s, ħ)
end
end

Expand Down Expand Up @@ -133,6 +136,7 @@ Defines a Gaussian channel for an N-mode bosonic system over a 2N-dimensional ph
## Fields

- `basis`: Symplectic representation for Gaussian channel.
- `basis_l`, `basis_r`: For QuantumInterface compatibility; always equal to `basis`.
- `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.
Expand Down Expand Up @@ -166,15 +170,17 @@ noise: 2×2 Matrix{Float64}:
4.0 2.0
```
"""
@kwdef struct GaussianChannel{B<:SymplecticBasis,D,T} <: AbstractOperator{D,T}
@kwdef struct GaussianChannel{B<:SymplecticBasis,D,T} <: AbstractOperator{B,B}
basis::B
basis_l::B = basis
basis_r::B = basis
disp::D
transform::T
noise::T
ħ::Number = 2
function GaussianChannel(b::B, d::D, t::T, n::T; ħ::Number = 2) where {B,D,T}
all(length(d) .== size(t) .== size(n) .== 2*(b.nmodes)) || throw(DimensionMismatch(CHANNEL_ERROR))
return new{B,D,T}(b, d, t, n, ħ)
return new{B,D,T}(b, b, b, d, t, n, ħ)
end
end

Expand Down
Loading