Skip to content

Commit 54c92bf

Browse files
committed
Depricate equal_bases
1 parent 5b629f4 commit 54c92bf

File tree

6 files changed

+22
-20
lines changed

6 files changed

+22
-20
lines changed

CHANGELOG.md

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

3+
## v0.3.9 - 2025-04-03
4+
5+
- Deprecate `equal_bases`.
6+
37
## v0.3.8 - 2025-03-08
8+
49
- Introduce `metrics.jl` file for metric declarations.
510

611
## v0.3.7 - 2025-01-16

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.8"
4+
version = "0.3.9"
55

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

src/QuantumInterface.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,6 @@ include("express.jl")
103103

104104
include("metrics.jl")
105105

106+
include("deprecated.jl")
107+
106108
end # module

src/bases.jl

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -120,23 +120,6 @@ function equal_shape(a, b)
120120
return true
121121
end
122122

123-
"""
124-
equal_bases(a, b)
125-
126-
Check if two subbases vectors are identical.
127-
"""
128-
function equal_bases(a, b)
129-
if a===b
130-
return true
131-
end
132-
for i=1:length(a)
133-
if a[i]!=b[i]
134-
return false
135-
end
136-
end
137-
return true
138-
end
139-
140123
"""
141124
Exception that should be raised for an illegal algebraic operation.
142125
"""

src/deprecated.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function equal_bases(a, b)
2+
Base.depwarn("`==` should be preferred over `equal_bases`!", :equal_bases)
3+
if a===b
4+
return true
5+
end
6+
for i=1:length(a)
7+
if a[i]!=b[i]
8+
return false
9+
end
10+
end
11+
return true
12+
end

test/test_bases.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using Test
2-
using QuantumInterface: tensor, , ptrace, reduced, permutesystems, equal_bases, multiplicable
2+
using QuantumInterface: tensor, , ptrace, reduced, permutesystems, multiplicable
33
using QuantumInterface: GenericBasis, CompositeBasis, NLevelBasis, FockBasis
44

55
@testset "basis" begin
@@ -49,7 +49,7 @@ comp1 = tensor(b1, b2, b3)
4949
comp2 = tensor(b2, b1, b3)
5050
@test permutesystems(comp1, [2,1,3]) == comp2
5151

52-
@test !equal_bases([b1, b2], [b1, b3])
52+
@test [b1, b2] != [b1, b3]
5353
@test !multiplicable(comp1, b1 b2 NLevelBasis(prod(b3.shape)))
5454

5555
end # testset

0 commit comments

Comments
 (0)