|
56 | 56 | QuantinuumAPI,
|
57 | 57 | QuantinuumAPIError,
|
58 | 58 | )
|
59 |
| -from pytket.extensions.quantinuum.backends.quantinuum import _ALL_GATES, GetResultFailed |
| 59 | +from pytket.extensions.quantinuum.backends.quantinuum import _ALL_GATES |
60 | 60 | from pytket.predicates import CompilationUnit
|
61 | 61 | from pytket.wasm import WasmFileHandler
|
62 | 62 |
|
@@ -530,11 +530,11 @@ def test_leakage_detection(
|
530 | 530 |
|
531 | 531 |
|
532 | 532 | @given(
|
533 |
| - n_shots=st.integers(min_value=1, max_value=10), # type: ignore |
| 533 | + n_shots=st.integers(min_value=1, max_value=10), |
534 | 534 | n_bits=st.integers(min_value=0, max_value=10),
|
535 | 535 | )
|
536 | 536 | @pytest.mark.timeout(120)
|
537 |
| -def test_shots_bits_edgecases(n_shots, n_bits) -> None: |
| 537 | +def test_shots_bits_edgecases(n_shots: int, n_bits: int) -> None: |
538 | 538 | quantinuum_backend = QuantinuumBackend("H1-1SC", machine_debug=True)
|
539 | 539 | c = Circuit(n_bits, n_bits)
|
540 | 540 |
|
@@ -597,18 +597,17 @@ def test_simulator(
|
597 | 597 | assert sum(stab_counts.values()) == n_shots
|
598 | 598 | assert len(stab_counts) == 2
|
599 | 599 |
|
600 |
| - # test non-clifford circuit fails on stabilizer backend |
601 |
| - # unfortunately the job is accepted, then fails, so have to check get_result |
| 600 | + # test non-clifford circuit fails predicate check |
| 601 | + # when run on stabilizer backend |
602 | 602 | non_stab_circ = (
|
603 | 603 | Circuit(2, name="non_stab_circ").H(0).Rx(0.1, 0).CX(0, 1).measure_all()
|
604 | 604 | )
|
605 | 605 | non_stab_circ = stabilizer_backend.get_compiled_circuit(non_stab_circ)
|
606 |
| - broken_handle = stabilizer_backend.process_circuit( |
607 |
| - non_stab_circ, n_shots, language=language |
608 |
| - ) |
609 | 606 |
|
610 |
| - with pytest.raises(GetResultFailed) as _: |
611 |
| - _ = stabilizer_backend.get_result(broken_handle) |
| 607 | + with pytest.raises(CircuitNotValidError): |
| 608 | + _ = stabilizer_backend.process_circuit( |
| 609 | + non_stab_circ, n_shots, noisy_simulation=False, language=language |
| 610 | + ) |
612 | 611 |
|
613 | 612 |
|
614 | 613 | @pytest.mark.skipif(skip_remote_tests, reason=REASON)
|
|
0 commit comments