QGL
QGL copied to clipboard
WIP: QASM3 Compilation
Rather than develop our own full-stack quantum circuit compiler and optimizer, we can use the relatively widely used QASM language to interface with other toolkits like QisKit and Cirq. The 3.0 release of QASM is a good match to QGL's capabilities for mixed classical/quantum control. It should be possible to compile many QASM3 programs into QGL sequences (up to what the sequencer supports).
A rough roadmap:
- [x] QASM3 lexer for tokenization
- [x] Parse tokens into CST
- [ ] Various transformations to go from CST -> AST
- [ ] Gate translation (from QASM U representation into concrete pulse library)
- [ ] Realtime function mapping (QASM
bit
to sequencer VRAM) and control flow - [ ] Tests tests tests!
Some open questions:
- Should we optimize gates at this level? We can re-use some of the
RandomCircuits.jl
infrastructure for compressing single qubit gates and decomposing 2-qubit gates. - How best to deal with subroutines and loops? Should we do some amount of inlining/unrolling?
- How to deal with classical instructions that aren't implemented (should we implement some of these?)