XanaduAI / strawberryfields

Strawberry Fields is a full-stack Python library for designing, simulating, and optimizing continuous variable (CV) quantum optical circuits.
https://strawberryfields.ai
Apache License 2.0
754 stars 191 forks source link

Add a function to qchem for computing state probability #419

Closed soranjh closed 4 years ago

soranjh commented 4 years ago

This PR adds the function prob to sf.apps.qchem.dynamics to compute the probability of observing a desired excitation in a list of samples.

codecov[bot] commented 4 years ago

Codecov Report

Merging #419 into master will increase coverage by 0.05%. The diff coverage is 99.24%.

@@            Coverage Diff             @@
##           master     #419      +/-   ##
==========================================
+ Coverage   97.84%   97.90%   +0.05%     
==========================================
  Files          58       63       +5     
  Lines        6784     6823      +39     
==========================================
+ Hits         6638     6680      +42     
+ Misses        146      143       -3     
Impacted Files Coverage Δ
strawberryfields/api/result.py 100.00% <ø> (ø)
...awberryfields/backends/gaussianbackend/__init__.py 100.00% <ø> (ø)
strawberryfields/backends/gaussianbackend/ops.py 100.00% <ø> (+2.70%) :arrow_up:
strawberryfields/circuitspecs/gaussian_unitary.py 100.00% <ø> (ø)
strawberryfields/circuitspecs/tensorflow.py 100.00% <ø> (ø)
strawberryfields/backends/fockbackend/ops.py 94.04% <94.11%> (+2.04%) :arrow_up:
strawberryfields/ops.py 98.84% <96.29%> (-0.19%) :arrow_down:
strawberryfields/backends/tfbackend/ops.py 96.69% <97.88%> (-0.17%) :arrow_down:
strawberryfields/apps/__init__.py 100.00% <100.00%> (ø)
strawberryfields/apps/qchem/__init__.py 100.00% <100.00%> (ø)
... and 32 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 9713d05...1bc7c0e. Read the comment docs.