Compilation for Dynamically Field-Programmable Qubit Arrays with Efficient and Provably Near-Optimal Scheduling. Open source under the BSD 3-Clause license.
- We recommend to run the compiler in a Python3 virtual environment.
- The file
enola/router/codegen.pyis based on a file from OLSQ-DPQA, so you need to installnetworkxandmatplotlib. - To compile circuits in the QASM format, you need
qiskitinstalled. We used the API inqiskit-1.1.0specifically. - The code for Misra&Gries coloring algorithm in
enola/scheduler/is from this Misra-Gries-coloring.
run.pyis an example of using the compiler on a circuit specified by a qubit interaction graph. Refer topython run.py -hfor options.run_qasm.pyis an example of using the compiler for circuits in the QASM format. Refer topython run_qasm.py -hfor options.enola/contains the source files implementing Enola.graphs.jsoncontains all the random 3-regular graphs we used as qubit interaction graphs.animation.pycontains the classAnimatorthat generates animations from the full code produced by Enola based on the implementation from Animation.py in OLSQ-DPQA. Refer topython animation.py -hfor options.simulator.pycontains the classSimulatorthat calculate the circuit fidelity based on Enola instructions. Refer topython simulator.py -hfor options.qasm_exp/is the directory containing one generic circuit example from QASMBench.results/is the default directory for the results.results/code/contains the code files generated from compilation results.results/animations/contains animation generated from full code files.results/fidelity/contains fidelity estimation based on code files.
- Run
python run.py <S> <I>where<S>is the number of vertices in the random 3-regular graph,<I>is the id of the graph. To try other graphs, please editrun.pyas needed.- Default setting: simulated annealing with dynamic placement, maximal independent set with sorting heuristic for routing strategy, no restriction for vectex number in solving MIS, and no animation code generation.
- The most scalable setting: trivial layout (
--trivial_layout), return to initial mapping after each Rydberg stage (--r2i), using maximal independent set for routing (--routing_strategy=maximalis), and limit the number of vertices to 1000 in solving MIS (--window).
For example,python run.py 30 0 --trivial_layout --r2i --routing_strategy=maximalis --window
- (Optional) To generate animation, run
python animation.py <F>where<F>is the full code file, e.g.,results/code/rand3reg_30_0_code_full.json.