diff --git a/CHANGELOG.md b/CHANGELOG.md index 98bfadb..9dc80a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # News +## v0.3.10 - 2025-04-21 + +- Deprecate `PauliBasis` as it is identical to `SpinBasis(1//2)^N` but without the compatibility with `CompositeBasis`. + ## v0.3.9 - 2025-04-20 - Implement general `tensor_pow` via `power_by_squaring` diff --git a/Project.toml b/Project.toml index 26cbd92..4b1f053 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "QuantumInterface" uuid = "5717a53b-5d69-4fa3-b976-0bf2f97ca1e5" authors = ["QuantumInterface.jl contributors"] -version = "0.3.9" +version = "0.3.10" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" diff --git a/src/bases.jl b/src/bases.jl index bc57c73..9969c1a 100644 --- a/src/bases.jl +++ b/src/bases.jl @@ -282,25 +282,6 @@ end Base.:(==)(b1::NLevelBasis, b2::NLevelBasis) = b1.N == b2.N -""" - PauliBasis(num_qubits::Int) - -Basis for an N-qubit space where `num_qubits` specifies the number of qubits. -The dimension of the basis is 2²ᴺ. -""" -struct PauliBasis{S,B} <: Basis - shape::S - bases::B - function PauliBasis(num_qubits::T) where {T<:Integer} - shape = [2 for _ in 1:num_qubits] - bases = Tuple(SpinBasis(1//2) for _ in 1:num_qubits) - return new{typeof(shape),typeof(bases)}(shape, bases) - end -end - -Base.:(==)(pb1::PauliBasis, pb2::PauliBasis) = length(pb1.bases) == length(pb2.bases) - - """ SpinBasis(n) diff --git a/src/deprecated.jl b/src/deprecated.jl index 0c74b0a..ad26bea 100644 --- a/src/deprecated.jl +++ b/src/deprecated.jl @@ -10,3 +10,17 @@ function equal_bases(a, b) end return true end + +struct PauliBasis{S,B} <: Basis + shape::S + bases::B + function PauliBasis(num_qubits::T) where {T<:Integer} + Base.depwarn("`PauliBasis` will be removed in future versions as it does not represent the Pauli operator basis. SpinBasis(1//2)^N or NLevelBasis(2)^N should likely be used instead.", :PauliBasis) + shape = [2 for _ in 1:num_qubits] + bases = Tuple(SpinBasis(1//2) for _ in 1:num_qubits) + return new{typeof(shape),typeof(bases)}(shape, bases) + end +end + +Base.:(==)(pb1::PauliBasis, pb2::PauliBasis) = length(pb1.bases) == length(pb2.bases) +