Skip to content

Commit

Permalink
use for loop
Browse files Browse the repository at this point in the history
Co-authored-by: Mark Koch <[email protected]>
  • Loading branch information
ss2165 and mark-koch committed Dec 12, 2024
1 parent e7e1be9 commit 0c73b04
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion guppylang/std/quantum.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,10 @@ def measure_array(qubits: array[qubit, N] @ owned) -> array[bool, N]:
"""Measure an array of qubits, returning an array of bools."""
return array(measure(q) for q in qubits)


@guppy
@no_type_check
def discard_array(qubits: array[qubit, N] @ owned) -> None:
"""Discard an array of qubits."""
_ = array(discard(q) for q in qubits)
for q in qubits:
discard(q)

0 comments on commit 0c73b04

Please sign in to comment.