Skip to content

Commit a0e80f0

Browse files
committed
Depricate PauliBasis
1 parent 15479d1 commit a0e80f0

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# News
22

3+
## v0.3.10 - 2025-04-21
4+
5+
- Deprecate `PauliBasis` as it is identical to `SpinBasis(1//2)^N` but without the compatibility with `CompositeBasis`.
6+
37
## v0.3.9 - 2025-04-20
48

59
- Implement general `tensor_pow` via `power_by_squaring`

src/bases.jl

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -282,25 +282,6 @@ end
282282
Base.:(==)(b1::NLevelBasis, b2::NLevelBasis) = b1.N == b2.N
283283

284284

285-
"""
286-
PauliBasis(num_qubits::Int)
287-
288-
Basis for an N-qubit space where `num_qubits` specifies the number of qubits.
289-
The dimension of the basis is 2²ᴺ.
290-
"""
291-
struct PauliBasis{S,B} <: Basis
292-
shape::S
293-
bases::B
294-
function PauliBasis(num_qubits::T) where {T<:Integer}
295-
shape = [2 for _ in 1:num_qubits]
296-
bases = Tuple(SpinBasis(1//2) for _ in 1:num_qubits)
297-
return new{typeof(shape),typeof(bases)}(shape, bases)
298-
end
299-
end
300-
301-
Base.:(==)(pb1::PauliBasis, pb2::PauliBasis) = length(pb1.bases) == length(pb2.bases)
302-
303-
304285
"""
305286
SpinBasis(n)
306287

src/deprecated.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,17 @@ function equal_bases(a, b)
1010
end
1111
return true
1212
end
13+
14+
struct PauliBasis{S,B} <: Basis
15+
shape::S
16+
bases::B
17+
function PauliBasis(num_qubits::T) where {T<:Integer}
18+
Base.depwarn("`PauliBasis` is not the Pauli operator basis will be removed in future versions.", :PauliBasis)
19+
shape = [2 for _ in 1:num_qubits]
20+
bases = Tuple(SpinBasis(1//2) for _ in 1:num_qubits)
21+
return new{typeof(shape),typeof(bases)}(shape, bases)
22+
end
23+
end
24+
25+
Base.:(==)(pb1::PauliBasis, pb2::PauliBasis) = length(pb1.bases) == length(pb2.bases)
26+

0 commit comments

Comments
 (0)