Skip to content

Commit

Permalink
TEst that pauli service is really working
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-villar committed Nov 12, 2024
1 parent 0d2b8d5 commit 5b0c36a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/ai/test_pauli_network_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def test_pauli_network_unexisting_url(random_circuit_transpiled, backend, caplog
assert isinstance(ai_optimized_circuit, QuantumCircuit)


def test_pauli_network_function(random_circuit_transpiled, backend):
def test_pauli_network_function(random_circuit_transpiled, backend, caplog):
ai_optimize_cliff = PassManager(
[
CollectPauliNetworks(),
Expand All @@ -109,14 +109,15 @@ def test_pauli_network_function(random_circuit_transpiled, backend):
)
ai_optimized_circuit = ai_optimize_cliff.run(random_circuit_transpiled)
assert isinstance(ai_optimized_circuit, QuantumCircuit)
assert "AIPauliNetworkAPI couldn't synthesize the circuit" not in caplog.text


# TODO: Look for a better way to parametrize coupling maps
@pytest.mark.parametrize(
"use_coupling_map_as_list", [True, False], ids=["as_list", "as_object"]
)
def test_pauli_network_function_with_coupling_map(
random_circuit_transpiled, coupling_map, use_coupling_map_as_list
random_circuit_transpiled, coupling_map, use_coupling_map_as_list, caplog
):
coupling_map_to_send = (
list(coupling_map.get_edges()) if use_coupling_map_as_list else coupling_map
Expand All @@ -129,3 +130,4 @@ def test_pauli_network_function_with_coupling_map(
)
ai_optimized_circuit = ai_optimize_cliff.run(random_circuit_transpiled)
assert isinstance(ai_optimized_circuit, QuantumCircuit)
assert "AIPauliNetworkAPI couldn't synthesize the circuit" not in caplog.text

0 comments on commit 5b0c36a

Please sign in to comment.