From 12b41873a796c3d9c4a374d43f239beaa056e553 Mon Sep 17 00:00:00 2001 From: Tommy Hofmann Date: Thu, 1 Aug 2024 19:39:04 +0200 Subject: [PATCH] fix test_nonclifford.jl --- test/test_bitpack.jl | 2 +- test/test_doctests.jl | 10 ++++------ test/test_nonclifford.jl | 4 +--- test/test_stabs.jl | 4 ++-- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/test/test_bitpack.jl b/test/test_bitpack.jl index f7db5100b..d56056d61 100644 --- a/test/test_bitpack.jl +++ b/test/test_bitpack.jl @@ -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); diff --git a/test/test_doctests.jl b/test/test_doctests.jl index 7956fc925..aa49544ba 100644 --- a/test/test_doctests.jl +++ b/test/test_doctests.jl @@ -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 diff --git a/test/test_nonclifford.jl b/test/test_nonclifford.jl index 50e755d38..0bf14682e 100644 --- a/test/test_nonclifford.jl +++ b/test/test_nonclifford.jl @@ -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) @@ -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 diff --git a/test/test_stabs.jl b/test/test_stabs.jl index 5f4067833..63a5c562e 100644 --- a/test/test_stabs.jl +++ b/test/test_stabs.jl @@ -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) @@ -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]