Skip to content

Commit

Permalink
[not working] clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
cqc-melf committed Mar 7, 2024
1 parent dda6e16 commit d1ad7f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 7 additions & 0 deletions pytket/extensions/qiskit/backends/ibmq_emulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ def __init__(
# Get noise model:
self._noise_model = NoiseModel.from_backend(self._ibmq._backend)

if self._ibmq._backend._backend_info.n_nodes > 32:
raise ValueError("ibmq_qasm_simulator only supports 32 qubits, \
devices with more than 32 qubtis can't be simulated")

if OpType.ECR in self._ibmq._backend._primitive_gates:
raise ValueError("ibmq_qasm_simulator does not support ECR in gateset")

# cache of results keyed by job id and circuit index
self._ibm_res_cache: Dict[Tuple[str, int], Counter] = dict()

Expand Down
6 changes: 2 additions & 4 deletions tests/backend_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,10 +470,9 @@ def test_nshots_batching(brisbane_backend: IBMQBackend) -> None:
@pytest.mark.flaky(reruns=3, reruns_delay=10)
@pytest.mark.skipif(skip_remote_tests, reason=REASON)
def test_nshots(
brisbane_emulator_backend: IBMQEmulatorBackend,
brisbane_local_emulator_backend: IBMQLocalEmulatorBackend,
) -> None:
for b in [AerBackend(), brisbane_emulator_backend, brisbane_local_emulator_backend]:
for b in [AerBackend(), brisbane_local_emulator_backend]:
circuit = Circuit(1).X(0)
circuit.measure_all()
n_shots = [1, 2, 3]
Expand Down Expand Up @@ -835,10 +834,9 @@ def test_operator_expectation_value() -> None:
@pytest.mark.flaky(reruns=3, reruns_delay=10)
@pytest.mark.skipif(skip_remote_tests, reason=REASON)
def test_ibmq_emulator(
ibmq_qasm_emulator_backend: IBMQEmulatorBackend,
brisbane_local_emulator_backend: IBMQLocalEmulatorBackend,
) -> None:
for b in [ibmq_qasm_emulator_backend, brisbane_local_emulator_backend]:
for b in [brisbane_local_emulator_backend]:
assert b._noise_model is not None # type: ignore
b_ibm = b._ibmq # type: ignore
b_aer = AerBackend()
Expand Down

0 comments on commit d1ad7f6

Please sign in to comment.