Skip to content

Commit

Permalink
Revert "Test coverage for fail cases in polynomial step"
Browse files Browse the repository at this point in the history
This reverts commit 00f6d8c.
  • Loading branch information
wrightjandrew committed Mar 16, 2024
1 parent 93eb20a commit f17eb1d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 34 deletions.
6 changes: 3 additions & 3 deletions tests/test_models_dbi.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ def test_double_bracket_iteration_scheduling_grid_hyperopt(
@pytest.mark.parametrize("n", [2, 4])
def test_double_bracket_iteration_scheduling_polynomial(backend, nqubits, n):
h0 = random_hermitian(2**nqubits, backend=backend, seed=seed)
d = backend.cast(np.diag(np.diag(backend.to_numpy(h0))))
dbi = DoubleBracketIteration(
Hamiltonian(nqubits, h0, backend=backend),
mode=DoubleBracketGeneratorType.single_commutator,
scheduling=DoubleBracketScheduling.polynomial_approximation,
)
initial_off_diagonal_norm = dbi.off_diagonal_norm
for _ in range(NSTEPS):
# by default, d is the diagonal resctriction of H
step1 = dbi.choose_step(n=n)
dbi(step=step1)
step1 = dbi.choose_step(d=d, n=n)
dbi(d=d, step=step1)
assert initial_off_diagonal_norm > dbi.off_diagonal_norm
1 change: 0 additions & 1 deletion tests/test_models_dbi_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def test_select_best_dbr_generator(backend, nqubits, step):
dbi = DoubleBracketIteration(
Hamiltonian(nqubits, h0, backend=backend),
mode=DoubleBracketGeneratorType.single_commutator,
scheduling=DoubleBracketScheduling.grid_search,
)
generate_Z = generate_Z_operators(nqubits)
Z_ops = list(generate_Z.values())
Expand Down
30 changes: 0 additions & 30 deletions tests/test_models_dbi_utils_scheduling.py

This file was deleted.

0 comments on commit f17eb1d

Please sign in to comment.