Closed soranjh closed 3 years ago
Merging #250 (b4165e2) into master (e32c40a) will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## master #250 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 21 21
Lines 1294 1293 -1
=========================================
- Hits 1294 1293 -1
Impacted Files | Coverage Δ | |
---|---|---|
thewalrus/samples.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 e32c40a...b4165e2. Read the comment docs.
Thanks @soranjh : can you confirm that when you do this change the user who made the issue in SF stops getting errors?
Thanks @soranjh : can you confirm that when you do this change the user who made the issue in SF stops getting errors?
Yes. The error disappears for one example.
Context: This PR modifies the
generate_hafnian_sample
function by renormalizing probabilities. The sum of the computed probabilities in this function is sometimes slightly larger than1.0
which leads to an error in generating random samples withnumpy.random.choice
. This error prevents simulating the vibronic properties of large molecules.Description of the Change: The
if
statement in line 157 ofsamples.py
is removed such that the probabilities are always renormalized if their sum is larger than 1.0.Related GitHub Issues: https://github.com/XanaduAI/strawberryfields/issues/597