From 286bfe6ca7e8bdd0e622b9efb7a6d87d2c132743 Mon Sep 17 00:00:00 2001 From: Tortar Date: Sat, 3 Aug 2024 22:23:55 +0200 Subject: [PATCH 1/3] Solve piracies and ambigities --- src/operators_dense.jl | 3 +++ src/states.jl | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/operators_dense.jl b/src/operators_dense.jl index e36f17f1..18285fb6 100644 --- a/src/operators_dense.jl +++ b/src/operators_dense.jl @@ -1,3 +1,4 @@ +import QuantumInterface import Base: isequal, ==, +, -, *, /, Broadcast import Adapt using Base.Cartesian @@ -27,6 +28,8 @@ Operator(qets::AbstractVector{<:Ket}) = Operator(first(qets).basis, GenericBasis Operator(basis_r::Basis,qets::AbstractVector{<:Ket}) = Operator(first(qets).basis, basis_r, qets) Operator(basis_l::BL,basis_r::BR,qets::AbstractVector{<:Ket}) where {BL,BR} = Operator{BL,BR}(basis_l, basis_r, reduce(hcat, getfield.(qets, :data))) +QuantumInterface.traceout!(s::QuantumOpticsBase.Operator, i) = QuantumInterface.ptrace(s,i) + Base.zero(op::Operator) = Operator(op.basis_l,op.basis_r,zero(op.data)) Base.eltype(op::Operator) = eltype(op.data) Base.eltype(::Type{T}) where {BL,BR,D,T<:Operator{BL,BR,D}} = eltype(D) diff --git a/src/states.jl b/src/states.jl index b632c177..ac318810 100644 --- a/src/states.jl +++ b/src/states.jl @@ -1,6 +1,8 @@ import Base: ==, +, -, *, /, length, copy, eltype import LinearAlgebra: norm, normalize, normalize! -import QuantumInterface: StateVector, AbstractKet, AbstractBra +import QuantumInterface: QuantumInterface, StateVector, AbstractKet, AbstractBra + +QuantumInterface.traceout!(s::QuantumOpticsBase.StateVector, i) = QuantumInterface.ptrace(s,i) """ Bra(b::Basis[, data]) From eaed3091513347c3ea604d804145769bb1434e78 Mon Sep 17 00:00:00 2001 From: Adriano Meligrana <68152031+Tortar@users.noreply.github.com> Date: Sun, 4 Aug 2024 11:58:49 +0200 Subject: [PATCH 2/3] fix --- src/states.jl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/states.jl b/src/states.jl index ac318810..b632c177 100644 --- a/src/states.jl +++ b/src/states.jl @@ -1,8 +1,6 @@ import Base: ==, +, -, *, /, length, copy, eltype import LinearAlgebra: norm, normalize, normalize! -import QuantumInterface: QuantumInterface, StateVector, AbstractKet, AbstractBra - -QuantumInterface.traceout!(s::QuantumOpticsBase.StateVector, i) = QuantumInterface.ptrace(s,i) +import QuantumInterface: StateVector, AbstractKet, AbstractBra """ Bra(b::Basis[, data]) From ef4235a9a724639de75dac91684c3e97079c18b9 Mon Sep 17 00:00:00 2001 From: Stefan Krastanov Date: Mon, 5 Aug 2024 17:19:34 -0400 Subject: [PATCH 3/3] version bump --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index b4e4ae11..1ea7487b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "QuantumOpticsBase" uuid = "4f57444f-1401-5e15-980d-4471b28d5678" -version = "0.5.1" +version = "0.5.2" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"