Skip to content
Closed
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# News

## v0.4.3 - 2026-06-08

- Add a `lazy` option to `QuantumOpticsRepr`.

## v0.4.2 - 2025-11-29

- Define `commutator` and `anticommutator`.
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "QuantumInterface"
uuid = "5717a53b-5d69-4fa3-b976-0bf2f97ca1e5"
authors = ["QuantumInterface.jl contributors"]
version = "0.4.2"
version = "0.4.3"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
15 changes: 11 additions & 4 deletions src/express.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,22 @@ express(s, repr::AbstractRepresentation) = express(s, repr, UseAsState())
# Commonly used representations -- interfaces for each one defined in separate packages
##

"""Representation using kets, bras, density matrices, and superoperators governed by `QuantumOptics.jl`."""
Base.@kwdef struct QuantumOpticsRepr <: AbstractRepresentation
cutoff::Int = 2
"""Representation using kets, bras, density matrices, and superoperators governed by `QuantumOptics.jl`.

Set `lazy=true` to request structure-preserving lazy operators where supported by
the target package.
"""
struct QuantumOpticsRepr <: AbstractRepresentation
cutoff::Int
lazy::Bool
end
QuantumOpticsRepr(; cutoff::Int=2, lazy::Bool=false) = QuantumOpticsRepr(cutoff, lazy)
QuantumOpticsRepr(cutoff::Int) = QuantumOpticsRepr(cutoff=cutoff)
"""Similar to `QuantumOpticsRepr`, but using trajectories instead of superoperators."""
struct QuantumMCRepr <: AbstractRepresentation end
"""Representation using tableaux governed by `QuantumClifford.jl`"""
struct CliffordRepr <: AbstractRepresentation end
"""Representation using Gaussian phase space formalism governed by `Gabs.jl`."""
struct GabsRepr{B} <: AbstractRepresentation
basis::B
end
end
13 changes: 12 additions & 1 deletion test/test_bases.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Test
using QuantumInterface: tensor, ⊗, ptrace, reduced, permutesystems, multiplicable
using QuantumInterface: GenericBasis, CompositeBasis, NLevelBasis, FockBasis
using QuantumInterface: GenericBasis, CompositeBasis, NLevelBasis, FockBasis, QuantumOpticsRepr

@testset "basis" begin

Expand Down Expand Up @@ -53,3 +53,14 @@ comp2 = tensor(b2, b1, b3)
@test !multiplicable(comp1, b1 ⊗ b2 ⊗ NLevelBasis(prod(b3.shape)))

end # testset

@testset "representations" begin
@test QuantumOpticsRepr().cutoff == 2
@test QuantumOpticsRepr().lazy == false
@test QuantumOpticsRepr(5).cutoff == 5
@test QuantumOpticsRepr(5).lazy == false
@test QuantumOpticsRepr(lazy=true).cutoff == 2
@test QuantumOpticsRepr(lazy=true).lazy == true
@test QuantumOpticsRepr(cutoff=4, lazy=true).cutoff == 4
@test QuantumOpticsRepr(cutoff=4, lazy=true).lazy == true
end