You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to enter some graphs into ZXLive using the "Input Circuit" function and realised that the most natural way to express them in OpenQASM would be to use the reset and measure operations.
I believe the reset operation (initialise a qubit to |0>) can be implemented by sticking an X vertex instead of a boundary on the input (left) side of the graph for that qubit. Also, would it make sense to use the InitAncilla gate to represent reset? I'm not sure what InitAncilla is used for.
Similarly, I think measure can be implemented as a parametrised spider on the output (right) of the graph instead of a boundary. Currently, qasmparser recognises measure as a valid command but just skips it when it encounters it, effectively treating it as a noop, so making this change may be breaking backwards compatibility. Also, it would be nice to be able to implement conditional gates using the created parameter too, though that might be difficult.
These two gates would be slightly different from the currently supported gates in that they would alter the number of effective input/output boundaries when converted to a graph. Is there anything relying on the assumption that the number of boundaries is twice the number of qubits, for example? Or any reason these two operations can't or shouldn't be implemented?
The text was updated successfully, but these errors were encountered:
InitAncilla was originally meant for an extension to circuit extraction to allow for ancillae to be placed, but in the end it was not used.
For the Input Circuit stuff, Aleks was playing around with an extension of his own called 'spider qasm' a couple of years ago, so that you can easily place spiders. It's in the demo's folder, under Spider Qasm tutorial. So maybe in ZXLive, that could also be supported.
I was trying to enter some graphs into ZXLive using the "Input Circuit" function and realised that the most natural way to express them in OpenQASM would be to use the
reset
andmeasure
operations.I believe the
reset
operation (initialise a qubit to|0>
) can be implemented by sticking an X vertex instead of a boundary on the input (left) side of the graph for that qubit. Also, would it make sense to use theInitAncilla
gate to representreset
? I'm not sure whatInitAncilla
is used for.Similarly, I think
measure
can be implemented as a parametrised spider on the output (right) of the graph instead of a boundary. Currently, qasmparser recognisesmeasure
as a valid command but just skips it when it encounters it, effectively treating it as a noop, so making this change may be breaking backwards compatibility. Also, it would be nice to be able to implement conditional gates using the created parameter too, though that might be difficult.These two gates would be slightly different from the currently supported gates in that they would alter the number of effective input/output boundaries when converted to a graph. Is there anything relying on the assumption that the number of boundaries is twice the number of qubits, for example? Or any reason these two operations can't or shouldn't be implemented?
The text was updated successfully, but these errors were encountered: