Skip to content

Commit d51409a

Browse files
committed
add more tests
1 parent fbd0e4b commit d51409a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/core-test/enr_state_operator.jl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
11
@testitem "Excitation number restricted state space" begin
2+
using StaticArraysCore
3+
4+
@testset "EnrSpace" begin
5+
s_enr = EnrSpace((2, 2, 3), 3)
6+
7+
# check if the idx2state is the same as qutip
8+
qutip_idx2state = Dict(
9+
1 => SVector{3}(0, 0, 0),
10+
2 => SVector{3}(0, 0, 1),
11+
3 => SVector{3}(0, 0, 2),
12+
4 => SVector{3}(0, 1, 0),
13+
5 => SVector{3}(0, 1, 1),
14+
6 => SVector{3}(0, 1, 2),
15+
7 => SVector{3}(1, 0, 0),
16+
8 => SVector{3}(1, 0, 1),
17+
9 => SVector{3}(1, 0, 2),
18+
10 => SVector{3}(1, 1, 0),
19+
11 => SVector{3}(1, 1, 1)
20+
)
21+
@test s_enr.idx2state == qutip_idx2state
22+
end
23+
224
@testset "kron" begin
325
# normal Space
426
D1 = 4

0 commit comments

Comments
 (0)