Skip to content

Commit

Permalink
Merge pull request QuantumSavory#296 from QuantumSavory/compactificat…
Browse files Browse the repository at this point in the history
…ionwarning

warning on failed compactification
  • Loading branch information
Krastanov authored Jun 19, 2024
2 parents 901b7b2 + ca36dcc commit 1636f2a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@

# News

## v0.9.4 - 2024-06-14
## v0.9.4 - 2024-06-19

- Addition of a constructor for concatenated quantum codes -- `Concat`.
- Addition of multiple unexported classical code constructors.
- Failed compactification of gates now only raises a warning instead of throwing an error. Defaults to slower non-compactified gates.
- Gate errors are now conveniently supported by the various ECC benchmark setups in the `ECC` module.
- Remove printing of spurious debug info from the PyBP decoder.
- Significant improvements to the low-level circuit compiler (the sumtype compactifier), leading to faster Pauli frame simulation of noisy circuits.
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Makie = "0.20, 0.21"
Nemo = "0.42, 0.43, 0.44, 0.45"
Plots = "1.38.0"
PrecompileTools = "1.2"
PyQDecoders = "0.2.0"
PyQDecoders = "0.2.1"
Quantikz = "1.3.1"
QuantumInterface = "0.3.3"
QuantumOpticsBase = "0.4.18"
Expand Down
7 changes: 6 additions & 1 deletion src/pauli_frames.jl
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,12 @@ function _pftrajectories(circuit;trajectories=5000,threads=true)
ccircuit = if eltype(circuit) <: CompactifiedGate
circuit
else
compactify_circuit(circuit)
try
compactify_circuit(circuit)
catch err
@warn "Could not compactify the circuit, falling back to a slower version of the simulation. Consider reporting this issue to the package maintainers to improve performance. The offending gate was `$(err.args[2])`."
circuit
end
end
frames = _create_pauliframe(ccircuit; trajectories)
nthr = min(Threads.nthreads(),trajectories÷(100))
Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ end
@doset "ecc_throws"
@doset "precompile"
@doset "pauliframe"
@doset "sumtypecompactification"
@doset "allocations"
VERSION >= v"1.10" && @doset "doctests"
get(ENV,"JET_TEST","")=="true" && @doset "jet"
Expand Down
7 changes: 7 additions & 0 deletions test/test_sumtypecompactification.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using Test
using QuantumClifford

@testset "SumTypes compactification" begin
@test_warn "Could not compactify the circuit" QuantumClifford.pftrajectories([ClassicalXOR{17}((65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81), 282)])
QuantumClifford.compactify_circuit([ClassicalXOR{3}((65, 66, 67), 282)])
end

0 comments on commit 1636f2a

Please sign in to comment.