Skip to content

Commit 8130a36

Browse files
authored
Adding broadcast wrapper. (#209)
* updating doc string * update doc string again
1 parent 5f2cead commit 8130a36

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/bloqade/squin/qubit.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,22 @@ def apply(operator: Op, qubits: ilist.IList[Qubit, Any] | list[Qubit]) -> None:
8989
...
9090

9191

92+
@wraps(Broadcast)
93+
def broadcast(operator: Op, qubits: ilist.IList[Qubit, Any] | list[Qubit]) -> None:
94+
"""Broadcast and apply an operator to a list of qubits. For example, an operator
95+
that expects 2 qubits can be applied to a list of 2n qubits, where n is an integer > 0.
96+
97+
Args:
98+
operator: The operator to broadcast and apply.
99+
qubits: The list of qubits to broadcast and apply the operator to. The size of the list
100+
must be inferable and match the number of qubits expected by the operator.
101+
102+
Returns:
103+
None
104+
"""
105+
...
106+
107+
92108
@wraps(Measure)
93109
def measure(qubits: ilist.IList[Qubit, Any]) -> int:
94110
"""Measure the qubits in the list."

0 commit comments

Comments
 (0)