Closed josh146 closed 4 years ago
Merging #438 into master will increase coverage by
0.12%
. The diff coverage is99.26%
.
@@ Coverage Diff @@
## master #438 +/- ##
==========================================
+ Coverage 97.84% 97.97% +0.12%
==========================================
Files 58 68 +10
Lines 6784 6949 +165
==========================================
+ Hits 6638 6808 +170
+ Misses 146 141 -5
Impacted Files | Coverage Δ | |
---|---|---|
strawberryfields/apps/plot.py | 100.00% <ø> (ø) |
|
strawberryfields/apps/train/embed.py | 100.00% <ø> (ø) |
|
...awberryfields/backends/gaussianbackend/__init__.py | 100.00% <ø> (ø) |
|
strawberryfields/backends/gaussianbackend/ops.py | 100.00% <ø> (+2.70%) |
:arrow_up: |
strawberryfields/utils/decorators.py | 100.00% <ø> (ø) |
|
strawberryfields/utils/post_processing.py | 100.00% <ø> (ø) |
|
strawberryfields/utils/program_functions.py | 97.77% <ø> (ø) |
|
strawberryfields/utils/random_numbers_matrices.py | 100.00% <ø> (ø) |
|
strawberryfields/utils/states.py | 100.00% <ø> (ø) |
|
strawberryfields/io.py | 97.70% <80.00%> (-1.13%) |
:arrow_down: |
... and 62 more |
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 e38de6e...b216e74. Read the comment docs.
[ch269]
I note that the tests involve adding dummy Rgate
parameters or so-called "final phases". That is, if I understand correctly, for the Xstrict compiler to work on e.g. X8_01, the supplied BB program must contain 4 S2gate
s, 12 MZgate
s, and 8 Rgate
s.
Is this correct? If so, I suppose the docstring for the Xstrict
class should be updated to mention the necessity of the inconsequential Rgate
s. However, I also wonder whether these gates should be supplied by users of the Xstrict compiler, or inserted by SF...
However, I also wonder whether these gates should be supplied by users of the Xstrict compiler, or inserted by SF...
@heltluke this is a good point. Is requiring the user add in the final phase gates too strict? What we could do is have the Xstrict
compiler add in final phase gates with phi=0
if they don't exist, so that the user doesn't need to specify them
Is requiring the user add in the final phase gates too strict? What we could do is have the
Xstrict
compiler add in final phase gates withphi=0
if they don't exist, so that the user doesn't need to specify them.
That sounds incredibly convenient to me, but I guess we should run this by a number of others as well. @tymomboe @DavidSPhillips @lneuhaus @xanadu-zvernon
That sounds incredibly convenient to me, but I guess we should run this by a number of others as well.
@heltluke I've just gone through the logic again, and unfortunately this is somewhat non-trivial just by construction. The way this compiler is written, it avoids compilation and just performs a simple equivalence check. I might merge this in now as-is, and we can make a new PR to add in this behaviour.
Adds a strict compiler for the X class of circuits.
Ensure that the compiled program exactly matches the devices topology. As a result, this compiler only accepts :
S2gate
,MZgate
, andMeasureFock()
operations.This compiler must be used with an X series device specification.