Skip to content

Commit

Permalink
[bugfix] [test] Fix integration tests and handling of null bit list (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
cqc-alec authored Aug 30, 2023
1 parent 7ce9b12 commit 9bd4229
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions pytket/extensions/quantinuum/backends/quantinuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,8 @@ def get_results_selection(handle: ResultHandle) -> Any:
if s == "":
return None
bits = json.loads(s)
if bits is None:
return None
assert all(isinstance(name, str) and isinstance(idx, int) for name, idx in bits)
return bits

Expand Down
4 changes: 2 additions & 2 deletions tests/integration/backend_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ def test_submission_with_group(
c.measure_all()
c = b.get_compiled_circuit(c)
n_shots = 10
shots = b.run_circuit(c, n_shots=n_shots, group="DEFAULT").get_shots() # type: ignore
shots = b.run_circuit(c, n_shots=n_shots, group="Default - UK").get_shots() # type: ignore
assert all(q[0] == q[1] for q in shots)


Expand Down Expand Up @@ -770,7 +770,7 @@ def test_allow_2q_gate_rebase(authenticated_quum_backend: QuantinuumBackend) ->
r = b.get_results(h)[0]
shots = r.get_shots()
assert len(shots) == 1
assert len(shots[0]) == 1
assert len(shots[0]) == 2


@pytest.mark.skipif(skip_remote_tests, reason=REASON)
Expand Down

0 comments on commit 9bd4229

Please sign in to comment.