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

2 comments on commit 899200c

@Krastanov
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/85951

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.8.6 -m "<description of version>" 899200c67c8fa2ddd68c454ced0294bb83b7a0bd
git push origin v0.8.6

Please sign in to comment.