mentpy
mentpy copied to clipboard
Support `OpenQASM` exports
This translation step should allow interpolation to other representations of quantum processes.
This would include PyZX, Qiskit, and perhaps others libraries commonplace in the ecosystem.
An initial strategy without writing an OpenQASM interpreter from scratch or having to be familiar with the spec yet:
- [ ] Convert a GraphState from and MBQCircuit into a quantum circuit using H state preparation and CZ gates
- [ ] Traverse the composition of gates using an intermediary syntax tree representation of the quantum circuit
- [ ] Compose an equivalent circuit in Qiskit after visiting each qubit
- [ ] Export Qiskit circuit to OpenQASM
A more direct strategy would write our own transpiler after the second step. Testing and maintaining that transpiler for correctness could create duplicate work, so I'd suggest norming against a trusted transpiler for now.
See also https://github.com/BestQuark/mentpy/issues/4