Closed josh146 closed 4 years ago
Merging #407 into update_fock_ops will increase coverage by
0.00%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## update_fock_ops #407 +/- ##
================================================
Coverage 97.84% 97.84%
================================================
Files 58 57 -1
Lines 6784 6740 -44
================================================
- Hits 6638 6595 -43
+ Misses 146 145 -1
Impacted Files | Coverage Δ | |
---|---|---|
...awberryfields/backends/gaussianbackend/__init__.py | 100.00% <ø> (ø) |
|
strawberryfields/backends/gaussianbackend/ops.py | 100.00% <ø> (+2.70%) |
:arrow_up: |
...rawberryfields/backends/gaussianbackend/backend.py | 98.56% <100.00%> (-0.11%) |
:arrow_down: |
...fields/backends/gaussianbackend/gaussiancircuit.py | 98.09% <100.00%> (-0.38%) |
:arrow_down: |
strawberryfields/backends/states.py | 97.41% <100.00%> (+0.31%) |
:arrow_up: |
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 cad48ad...bf66e89. Read the comment docs.
Context: More Fock-basis functionality is available for Gaussian state post-processing thanks to The Walrus. This PR integrates the latest Walrus functionality, elevating the Gaussian state to the same level of functionality as the Fock state.
Description of the Change:
Removes the
gaussianbackend.GaussianState
class. It is now sufficient to simply useBaseGaussianState
, and import needed functions from The Walrus. As a result, several functions in thegaussianbackend.ops
package are no longer being used and can be removed:fock_amplitudes_one_mode
fock_prob
sm_fidelity
xmat
omega
BaseGaussianState
now supportsket
,dm
, andall_fock_probs
. As a result, these are now abstract methods inBaseState
. The tests have been updated so existing tests for these methods are now run on the Gaussian backend.BaseGaussianState
now uses The Walrus to implementreduced_dm
,fidelity
, andfock_prob
.The
states.rst
quickstart has been updated with the new functionality.Benefits: The Gaussian state is now feature complete with the Fock state.
Possible Drawbacks: Some of the new functionality is only available in the latest version of The Walrus 0.13.0-dev. Unfortunately, this version of The Walrus breaks Fock gate compatibility. Therefore, this PR branches off #381, as the corresponding Walrus fix has already been implemented there.
Related GitHub Issues: n/a