Skip to content

Commit

Permalink
add physics simulator to parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
lazyoracle committed Dec 29, 2021
1 parent 7ad01c4 commit 1ca3732
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions test/test_qiskit.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ def test_backends():

@pytest.mark.unit
@pytest.mark.qiskit
@pytest.mark.parametrize("backend", ["c3_qasm_perfect_simulator"])
@pytest.mark.parametrize(
"backend", ["c3_qasm_perfect_simulator", "c3_qasm_physics_simulator"]
)
def test_get_backend(backend):
"""Test get_backend() which returns the backend with matching name
Expand Down Expand Up @@ -134,12 +136,18 @@ def test_qiskit_physics():
print(job_sim.result().get_counts())


@pytest.mark.parametrize("backend", ["c3_qasm_perfect_simulator"])
@pytest.mark.parametrize(
"backend",
[
("c3_qasm_perfect_simulator", "test/quickstart.hjson"),
("c3_qasm_physics_simulator", "test/qiskit.cfg"),
],
)
def test_too_many_qubits(backend):
c3_qiskit = C3Provider()
backend = c3_qiskit.get_backend(backend)
backend.set_device_config("test/quickstart.hjson")
received_backend = c3_qiskit.get_backend(backend[0])
received_backend.set_device_config(backend[1])
qc = QuantumCircuit(4, 4)
qc.x(1)
with pytest.raises(C3QiskitError):
execute(qc, backend, shots=1000)
execute(qc, received_backend, shots=1000)

0 comments on commit 1ca3732

Please sign in to comment.