Skip to content

Commit

Permalink
JET simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Krastanov committed Jun 20, 2023
1 parent 9917f6a commit 899200c
Showing 1 changed file with 3 additions and 29 deletions.
32 changes: 3 additions & 29 deletions test/test_jet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ using ArrayInterface
using Static
using Graphs
using LinearAlgebra
using Polyester

using JET: ReportPass, BasicPass, InferenceErrorReport, UncaughtExceptionReport

Expand All @@ -22,42 +23,15 @@ function (::MayThrowIsOk)(report_type::Type{<:InferenceErrorReport}, @nospeciali
end

@testset "JET checks" begin
@test isempty(JET.get_reports(@report_call random_destabilizer(10)))
@test isempty(JET.get_reports(@report_call random_stabilizer(10)))
@test isempty(JET.get_reports(@report_call random_clifford(10)))

s = random_stabilizer(10)
p = random_pauli(10)
c = random_clifford(10)
c2 = random_clifford(2)
@test isempty(JET.get_reports(@report_call project!(s,p)))
@test isempty(JET.get_reports(@report_call apply!(s,p)))
@test isempty(JET.get_reports(@report_call apply!(s,c)))
@test isempty(JET.get_reports(@report_call apply!(s,sCNOT(1,2))))
@test isempty(JET.get_reports(@report_call apply!(s,sHadamard(1))))
@test isempty(JET.get_reports(@report_call apply!(s,c2,[1,2])))
@test isempty(JET.get_reports(@report_call canonicalize!(s)))
@test isempty(JET.get_reports(@report_call canonicalize_gott!(s)))
@test isempty(JET.get_reports(@report_call canonicalize_rref!(s)))

@test isempty(JET.get_reports(@report_call QuantumClifford._project!(s,p)))
@test isempty(JET.get_reports(@report_call QuantumClifford._apply!(s,p)))
@test isempty(JET.get_reports(@report_call QuantumClifford._apply!(s,c)))
@test isempty(JET.get_reports(@report_call QuantumClifford._apply!(s,sCNOT(1,2))))
@test isempty(JET.get_reports(@report_call QuantumClifford._apply!(s,sHadamard(1))))
@test isempty(JET.get_reports(@report_call QuantumClifford._apply!(s,c2,[1,2])))
@test isempty(JET.get_reports(@report_call QuantumClifford._canonicalize!(s)))
@test isempty(JET.get_reports(@report_call QuantumClifford._canonicalize_gott!(s)))
@test isempty(JET.get_reports(@report_call QuantumClifford._canonicalize_rref!(s,[1,3])))

rep = report_package("QuantumClifford";
report_pass=MayThrowIsOk(),
ignored_modules=(
AnyFrameModule(Graphs.LinAlg),
AnyFrameModule(Graphs.SimpleGraphs),
AnyFrameModule(ArrayInterface),
AnyFrameModule(Static),
AnyFrameModule(LinearAlgebra)
AnyFrameModule(LinearAlgebra),
AnyFrameModule(Polyester)
)
)
@show rep
Expand Down

0 comments on commit 899200c

Please sign in to comment.