-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Currently the qubit dialect, under the squin umbrella, contains key statements for writing squin programs but makes UX a bit odd (unless you explicitly import qubit as a separate thing but this harkens back to QuEraComputing/bloqade#287)
from bloqade import squin
@squin.kernel
def prog():
q = squin.qubit.new(10)
squin.x(q[1])
squin.broadcast.h(q)
measurement_results = squin.qubit.measure(q)It would be much nicer if a user could just do squin.measure instead. I understand post- #518 the qubit.new will be a nicer squin.qalloc.
I realize a particularly easy way would be to just do some kind of re-export but then if we have operations like Reset (pending a wrapper: #545 - one that I'd like to add post conclusion on this RFC) is it best they follow the split we have between single and broadcasted qubit operations? Or should Reset follow something like Measure with a MeasureAny blanket statement + desugaring?
I think of a similar issue for get_qubit_id and get_measurement_id. Right now they only accept singular instances of Qubits and MeasurementResults. Do we want them to be broadcastable too? Like
qs = squin.qubit.new(10)
ids : IList[int] = get_qubit_id(qs)
# but could also do
id: int = get_qubit_id(q[0])