Genesis is a compiler framework for Hamiltonian simulation targeting hybrid continuous-variable (CV) and discrete-variable (DV) quantum systems. It supports multi-level compilation, Hybrid CV-DV domain-specific language (DSL), and hardware circuit mapping and routing.
- Hamiltonian Parsing: Translates a Hamiltonian from mathematical form into a DSL-based representation.
- Intermediate Representation (IR): Converts the DSL into an IR consisting of Pauli strings and operator expressions.
- Pattern Matching and Gate Synthesis: Matches fermionic and bosonic operator terms and synthesizes them into logical CV-DV circuits in
CVDVQASMformat. - Physical Mapping: Maps logical circuits and Pauli terms to hardware-compliant physical circuits, and outputs the final(physical)
CVDVQASMprogram(s).
- [2025-06-25] Genesis[1] was presented at the International Symposium on Computer Architecture (ISCA) 2025.
- [2025-05-11] Genesis v1.0.0 released.
- Python ≥ 3.8
- Java (for ANTLR)
We recommend using a Python virtual environment:
python3 -m venv Genesis
source Genesis/bin/activateThen install dependencies:
pip install -r requirements.txtDownload ANTLR 4.13.0 into the antlr directory:
mkdir antlr
cd antlr
curl -O https://www.antlr.org/download/antlr-4.13.0-complete.jarTo generate the Python parser from the grammar file, run:
mkdir grammar generated
cd grammar
java -jar ../antlr/antlr-4.13.0-complete.jar -Dlanguage=Python3 -visitor hamiltonianDSL.g4 -o ../generatedThe generated files will be saved to the generated/ directory.
Benchmark Hamiltonians (*.ham) are provided in the benchmark/ directory. To define new Hamiltonians using Genesis DSL, see Hamiltonian DSL Specification.
Genesis supports:
- Single-file mode
- Batch JSON mode
- Optional modes:
--debug,--stats, and--clean
python3 -m src.main benchmark/electronicVibration_small.hamThe output file will be defaulted to the same name as the input file, with a .cvdvqasm extension in output/ directory. You can also use -o or --output to specify the output file path.
python3 -m src.main benchmark/electronicVibration_small.ham -o output/electronicVibration_small.cvdvqasmpython3 -m src.main --batch-json tests/small_batch_jobs.jsonExample small_batch_jobs.json:
[
{
"input_file": "benchmark/hubbardHolstein_small.ham",
"output_file": "output/hubbardHolstein_small.cvdvqasm"
},
{
"input_file": "benchmark/electronicVibration_small.ham",
"output_file": "output/electronicVibration_small.cvdvqasm"
}
]--debug: Adds debug comments in output.cvdvqasmfiles--stats: Generates a JSON report of compilation statistics--clean: Removes intermediate files
Transforms polynomial fermion/boson operators to hybrid CV-DV gate sequences, given an .afe file and an index to start ancilla qubits at. When called via command line, the output is printed out to standard output, which can then be piped elsewhere.
For example, using tests/single_testcase/testcase1.afe, which represents
exp(prod((-1.5708j),dagger(b(0)),b(0)))We can run the operator pattern matching tool on this single testcase:
python3 -m src.pattern_match tests/single_testcase/testcase1.afe 0 > output/output.logThe output will be saved in output/output.log, 0 is the index of the potential ancilla qubit.
Smaller test cases involving pattern matching and mapping can be ran by the commands below:
python3 -m tests.single_testcase.test_single_testcase > tests/single_testcase/test_single_testcase_outlog.txtpython3 -m tests.pauli_map_test.test_pauli_map > tests/pauli_map_test/test_pauli_map_outlog.txtTo run the mapping algorithm on the given Qubit hamiltonians in qubit_hamiltonians folder, execute src.decomp_molecule akin to how one would run main. For example:
python3 -m src.decomp_molecule qubit_hamiltonians/LiH/BK_LiH_sto3g_4_electrons_12_spin_orbitals_Hamiltonian_631_paulis.txtpython3 -m src.decomp_molecule --batch-json tests/molecule_small_batch_jobs.jsonThe batch JSON shares the same format as the other example, but requires a different type of input file, looking like this:
[
{
"input_file": "qubit_hamiltonians/LiH/BK_LiH_sto3g_4_electrons_12_spin_orbitals_Hamiltonian_631_paulis.txt",
"output_file": "output/small_molecule_benchmark/BK_LiH_sto3g_4_electrons_12_spin_orbitals_Hamiltonian_631_paulis.cvdvqasm"
},
{
"input_file": "qubit_hamiltonians/LiH/JW_LiH_sto3g_4_electrons_12_spin_orbitals_Hamiltonian_631_paulis.txt",
"output_file": "output/small_molecule_benchmark/BK_LiH_sto3g_4_electrons_12_spin_orbitals_Hamiltonian_631_paulis.cvdvqasm"
}
]A comprehensive set of demonstration usage examples and general benchmark evaluation is provided in the Demo Jupyter notebook Demo.
- Eddy Z. Zhang — eddyzhengzhang [at] gmail.com
- Zihan Chen — zihan.chen.cs [at] rutgers.edu
- Henry Chen — hc867 [at] scarletmail.rutgers.edu
[1] Chen, Zihan, Jiakang Li, Minghao Guo, Henry Chen, Zirui Li, Joel Bierman, Yipeng Huang, Huiyang Zhou, Yuan Liu, and Eddy Z. Zhang. "Genesis: A Compiler for Hamiltonian Simulation on Hybrid CV-DV Quantum Computers." In Proceedings of the 52nd Annual International Symposium on Computer Architecture, pp. 1583-1597. 2025.
