Skip to content

Commit

Permalink
Loosen differentiator test tols.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelBroughton committed Apr 14, 2021
1 parent d3c5bbf commit 43a98ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,10 @@ def test_get_gradient_circuits(self):
self.assertAllEqual(expected_new_symbol_names, test_new_symbol_names)
self.assertAllClose(expected_batch_symbol_values,
test_batch_symbol_values,
atol=1e-6)
atol=1e-5)
self.assertAllClose(expected_batch_weights,
test_batch_weights,
atol=1e-6)
atol=1e-5)
self.assertAllEqual(expected_batch_mapper, test_batch_mapper)

@parameterized.parameters(
Expand Down Expand Up @@ -333,7 +333,7 @@ def test_gradient_circuits_grad_comparison(self, differentiator, n_qubits,
exact_outputs = differentiable_op(programs, symbol_names_tensor,
symbol_values_tensor, ops_tensor)
grad_auto = g.gradient(exact_outputs, symbol_values_tensor)
self.assertAllClose(grad_manual, grad_auto)
self.assertAllClose(grad_manual, grad_auto, atol=1e-5)


if __name__ == "__main__":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ def test_get_gradient_circuits(self):
self.assertAllEqual(expected_new_symbol_names, test_new_symbol_names)
self.assertAllClose(expected_batch_symbol_values,
test_batch_symbol_values,
atol=1e-6)
atol=1e-5)
self.assertAllClose(expected_batch_weights,
test_batch_weights,
atol=1e-6)
atol=1e-5)
self.assertAllEqual(expected_batch_mapper, test_batch_mapper)

@parameterized.parameters(
Expand Down Expand Up @@ -258,7 +258,7 @@ def test_gradient_circuits_grad_comparison(self, differentiator, n_qubits,
exact_outputs = differentiable_op(programs, symbol_names_tensor,
symbol_values_tensor, ops_tensor)
grad_auto = g.gradient(exact_outputs, symbol_values_tensor)
self.assertAllClose(grad_manual, grad_auto)
self.assertAllClose(grad_manual, grad_auto, atol=1e-5)


if __name__ == "__main__":
Expand Down

0 comments on commit 43a98ac

Please sign in to comment.