Skip to content

Commit

Permalink
Update strawberryfields/backends/fockbackend/circuit.py
Browse files Browse the repository at this point in the history
  • Loading branch information
josh146 authored Apr 14, 2020
1 parent 21bb21f commit 4de1d46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion strawberryfields/backends/fockbackend/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ def measure_homodyne(self, phi, mode, select=None, **kwargs):
# Due to floating point precision error, values in the calculated probability distribution
# may have a very small negative value of -epsilon. The following sets
# these small negative values to 0.
probs[np.abs(probs) < 1e-16] = 0
probs[np.abs(probs) < 1e-10] = 0

sample_hist = np.random.multinomial(1, probs)
sample_idx = list(sample_hist).index(1)
Expand Down

0 comments on commit 4de1d46

Please sign in to comment.