Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion netqasm/sdk/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2080,7 +2080,7 @@ def cleanup(_: BaseNetQASMConnection):
# Otherwise: free the qubits.
if not params.sequential:
for q in qubits:
q.free()
q.free(deactivate=False)

loop.set_cleanup_code(cleanup)

Expand Down
18 changes: 17 additions & 1 deletion tests/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,15 @@ def test_create_epr_min_fidelity_all():
epr_socket = EPRSocket("Bob")

with DebugConnection("Alice", epr_sockets=[epr_socket]) as conn:
epr_socket.create_keep(number=2, min_fidelity_all_at_end=80, max_tries=100)
qubits = epr_socket.create_keep(
number=2, min_fidelity_all_at_end=80, max_tries=100
)

# Check that qubits can be used for following instructions
q1, q2 = qubits
q1.cnot(q2)
q1.measure()
q2.measure()

subroutine = conn._builder.subrt_pop_pending_subroutine()
print(subroutine)
Expand All @@ -779,6 +787,14 @@ def test_create_epr_min_fidelity_all():
PatternWildcard.ANY_ZERO_OR_MORE,
GenericInstr.JMP,
PatternWildcard.BRANCH_LABEL,
PatternWildcard.ANY_ZERO_OR_MORE,
GenericInstr.CNOT,
PatternWildcard.ANY_ZERO_OR_MORE,
GenericInstr.MEAS,
PatternWildcard.ANY_ZERO_OR_MORE,
GenericInstr.MEAS,
PatternWildcard.ANY_ZERO_OR_MORE,
GenericInstr.RET_ARR,
]
)

Expand Down
Loading