Skip to content

Commit

Permalink
fix test_nonclifford.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
thofma committed Aug 1, 2024
1 parent 319f6d7 commit 46da774
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion test/test_bitpack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Random
using QuantumClifford: Tableau

@testitem "alternative bit packing" begin
@testset "alternative bit packing" begin
for n in [1,3] # can not go higher than 4 (limitation from SIMD acting on transposed/strided arrays)
N = 64*n-2
s64 = random_stabilizer(N,N);
Expand Down
10 changes: 4 additions & 6 deletions test/test_doctests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@

ENV["LINES"] = 80 # for forcing `displaysize(io)` to be big enough
ENV["COLUMNS"] = 80
@testset "Doctests" begin
DocMeta.setdocmeta!(QuantumClifford, :DocTestSetup, :(using QuantumClifford; using QuantumClifford.ECC); recursive=true)
doctest(QuantumClifford,
#fix=true
)
end
DocMeta.setdocmeta!(QuantumClifford, :DocTestSetup, :(using QuantumClifford; using QuantumClifford.ECC); recursive=true)
doctest(QuantumClifford,
#fix=true
)
end
4 changes: 1 addition & 3 deletions test/test_jet.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Test
using QuantumClifford
@testitem "JET checks" tags=[:jet] begin
using JET
using ArrayInterface
using Static
Expand All @@ -23,7 +22,6 @@ function (::MayThrowIsOk)(report_type::Type{<:InferenceErrorReport}, @nospeciali
BasicPass()(report_type, args...)
end

@testitem "JET checks" tags=[:jet] begin
rep = report_package("QuantumClifford";
report_pass=MayThrowIsOk(),
ignored_modules=(
Expand Down
4 changes: 1 addition & 3 deletions test/test_nonclifford.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
using InteractiveUtils
using Random

##

@testset "Pauli decomposition into destabilizers" begin
for n in [1,2,63,64,65,66,300]
p = random_pauli(n; nophase=true)
Expand Down Expand Up @@ -32,7 +30,7 @@
apply!(state, tgate)
apply!(state, tgate)

@test state.destabweights |> values |> collect == [1]
@test isapprox(state.destabweights |> values |> collect, [1])
@test state.destabweights |> keys |> collect == [([1],[1])]
end

Expand Down
4 changes: 2 additions & 2 deletions test/test_stabs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
end
end

@testitem "Tensor products over stabilizers" begin
@testset "Tensor products over stabilizers" begin
for n in test_sizes
n<10 && continue
l = random_stabilizer(rand(n÷2+1:n-2),n)
Expand All @@ -58,7 +58,7 @@
end
end

@testitem "Stabilizer indexing" begin
@testset "Stabilizer indexing" begin
s = random_stabilizer(9,10)
@test s[1,1] == s[[1,3,4],[1,3,5]][1,1]
@test s[1,1] == s[:,[1,3,5]][1,1]
Expand Down

0 comments on commit 46da774

Please sign in to comment.