Skip to content

Commit

Permalink
corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
Simone-Bordoni committed May 30, 2024
1 parent 8bbde0c commit b81b0e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_models_variational.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,12 @@ def test_qaoa_errors(backend):
def test_qaoa_optimization(backend, method, options, dense, filename):
if (method == "sgd") and (backend.name not in ["tensorflow", "pytorch"]):
pytest.skip("Skipping SGD test for unsupported backend.")
if method != "sgd" and backend.name == "pytorch":
pytest.skip("Skipping scipy optimizers for pytorch.")
if method != "sgd" and backend.name in ("tensorflow", "pytorch"):
pytest.skip("Skipping scipy optimizers for tensorflow and pytorch.")
h = hamiltonians.XXZ(3, dense=dense, backend=backend)
qaoa = models.QAOA(h)
initial_p = [0.05, 0.06, 0.07, 0.08]
initial_p = backend.cast(initial_p)
initial_p = backend.cast(initial_p, dtype=np.float64)
best, params, _ = qaoa.minimize(initial_p, method=method, options=options)
if filename is not None:
assert_regression_fixture(backend, params, filename)
Expand Down

0 comments on commit b81b0e2

Please sign in to comment.