Skip to content

Commit

Permalink
Remove leftover debug prints in unit tests (#7261)
Browse files Browse the repository at this point in the history
In #6551 a few debug prints slipped into the unittests which are dumping
arrays to stdout during unit test runs. This commit just cleans those up
and removes the stray prints.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
mtreinish and mergify[bot] authored Nov 12, 2021
1 parent 4bc5fb5 commit 48916d8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
1 change: 0 additions & 1 deletion test/python/quantum_info/xx_decompose/test_polytopes.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def test_nearest(self, offbody, expected):
"""Check that the nearest point calculator recovers some known cases."""
polytope = XXPolytope.from_strengths(pi / 6, pi / 8, pi / 10)
result = polytope.nearest(np.array(offbody))
print(offbody, result)
self.assertTrue(np.all(np.abs(np.array(expected) - result) < EPSILON))

def test_add_strengths(self):
Expand Down
8 changes: 0 additions & 8 deletions test/python/quantum_info/xx_decompose/test_weyl.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ def test_reflections(self):
original_matrix = canonical_matrix(*coordinate)
reflected_matrix = canonical_matrix(*reflected_coordinate)
reflect_matrix = Operator(reflection_circuit).data
with np.printoptions(precision=3, suppress=True):
print(name)
print(reflect_matrix.conjugate().transpose(1, 0) @ original_matrix @ reflect_matrix)
print(reflected_matrix * reflection_phase)
self.assertTrue(
np.all(
np.abs(
Expand All @@ -76,10 +72,6 @@ def test_shifts(self):
original_matrix = canonical_matrix(*coordinate)
shifted_matrix = canonical_matrix(*shifted_coordinate)
shift_matrix = Operator(shift_circuit).data
with np.printoptions(precision=3, suppress=True):
print(name)
print(original_matrix @ shift_matrix)
print(shifted_matrix * shift_phase)
self.assertTrue(
np.all(
np.abs(original_matrix @ shift_matrix - shifted_matrix * shift_phase) < EPSILON
Expand Down

0 comments on commit 48916d8

Please sign in to comment.