Skip to content

Commit

Permalink
Add missing atol argument to floating-point test (#10439) (#10440)
Browse files Browse the repository at this point in the history
The other assertion in this test has the `atol` parameter, but this one
is missing it, which can occasionally lead to off-by-one-bit differences
in the complex multiplication outputs.

(cherry picked from commit fafb750)

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
  • Loading branch information
mergify[bot] and jakelishman committed Jul 17, 2023
1 parent 2317c83 commit 9ac4e8a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ def test_mul(self, num_qubits, value, param):
if value == 0:
np.testing.assert_array_equal(value_mat, target.astype(complex))
else:
np.testing.assert_allclose(value_mat, target)
np.testing.assert_allclose(value_mat, target, atol=1e-8)
np.testing.assert_array_equal(op.paulis.phase, np.zeros(op.size))
target = spp_op.to_matrix() * value
op = spp_op * value
Expand Down

0 comments on commit 9ac4e8a

Please sign in to comment.