Skip to content

Commit f7aaafa

Browse files
authored
Depricate PauliBasis (#52)
1 parent 15479d1 commit f7aaafa

File tree

4 files changed

+19
-20
lines changed

4 files changed

+19
-20
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`

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "QuantumInterface"
22
uuid = "5717a53b-5d69-4fa3-b976-0bf2f97ca1e5"
33
authors = ["QuantumInterface.jl contributors"]
4-
version = "0.3.9"
4+
version = "0.3.10"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

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` 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)
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)