Closed jakeffbulmer closed 3 years ago
Merging #603 (ec20d89) into master (9f6debb) will increase coverage by
0.00%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #603 +/- ##
=======================================
Coverage 98.50% 98.50%
=======================================
Files 77 77
Lines 8835 8859 +24
=======================================
+ Hits 8703 8727 +24
Misses 132 132
Impacted Files | Coverage Δ | |
---|---|---|
strawberryfields/compilers/gaussian_unitary.py | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 9f6debb...ec20d89. Read the comment docs.
The speedup isn't massive, I just tried a 100 mode circuit with 100 SMSV states followed by ~5000 beam splitters. The compile time went from 2.6s to 660ms.
I'd say a factor of 4 is still pretty nice!
Context: The gaussian_unitary compiler takes a full Gaussian circuit and compiles it into an interferometer -> squeezing -> interferometer -> displacement circuit. Previously, it would compute an MxM matrix-matrix multiplication for each additional gate. Here, we make this faster by replacing the expand and multiply operations with a custom function.
Description of the Change: the functions
_apply_symp_one_mode_gate
and_apply_symp_two_mode_gate
, defined incompilers/gaussian_unitary.py
update symplectic transformations and means vectors in linear time complexity.Benefits: Running the
gaussian_unitary
compiler should be much faster for large numbers of modes.Possible Drawbacks:
Related GitHub Issues: