Skip to content

carlasophie/CFHS_simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clifford Fullstate Hybrid Simulation (CFHS)

arXiv

The CFHS approach is a classical fullstate simulator that simulates Clifford gates at negligible cost, and emulates all non-Clifford gates in the form of multi-qubit rotations. We achieve a substantial speed-up in runtime that is constant in the locality of the respective Hamiltonian.

This is the code repository for the paper:

Hybrid Method of Efficient Simulation of Physics Applications for a Quantum Computer
Carla Rieger, Albert T. Schmitz, Gehad Salem, Massimiliano Incudini, Sofia Vallecorsa, Anne Y. Matsuura, Michele Grossi, Gian Giacomo Guerreschi
arXiv:2602.09020 [quant-ph]

Reproducing Paper Results

We provide the Hamiltonian data used for our timing experiments evaluating the CFHS approach. The experimental evaluation was twofold; we evaluated random Hamiltonians and a set of chemistry Hamiltonians from HamLib (Sawaya et al., Quantum 2024). The analysis folder contains the scripts to reproduce the analysis figure for both the random Hamiltonian and HamLib experiments.

Script Reproduces
benchmarking/run.py Generates the data of the random Hamiltonians with different locality, number of terms, and number of qubits. Downloads the selected Hamlib Hamiltonians and generates the .cpp and .hpp files used for our experiments.
analysis/analysis_rh.ipynb Reproduces the analysis figures for the random Hamiltonian experiments.
analysis/analysis_hamlib.ipynb Reproduces the analysis figures for the Hamlib Hamiltonian experiments.

Repository Structure

.
├── benchmarking/   # Hamiltonian dataset generation and generation of the .cpp and .hpp files for the benchmarking experiments
├── mqrot/          # Main source code for the mqrot type, including the trotter circuit generation and HamLib parsing
├── analysis/       # Reproduces the analysis figures for the random Hamiltonian and HamLib experiments
├── requirements.txt
└── README.md

Install mqrot

Ensure you have Python version >= 3.9 installed.

  1. Clone and install the mat2qubit repository:

    cd ..
    git clone https://github.com/IntelLabs/mat2qubit.git
    cd mat2qubit/
    python setup.py bdist_wheel
    pip install dist/*.whl
  2. Install the mqrot type:

    make init
    make install
  3. The successful installation can be verified by running the unit tests:

    make utest

Download datasets

Generate random Hamiltonians

To generate the random Hamiltonians, run the following script. The random Hamiltonians are generated using the existing code in mqrot. They are then converted to OpenFermion operator and saved to HDF5 file in the same format as the other HamLib objects under dataset name "RH". In this way, the processing of these random hamiltonians is identical to the processing of the rest of the test bench. A CSV file is create that contains the list of generated objects.

mkdir -p hdf5_rh_files cpp_rh_files hpp_rh_files
python3 run.py create-random-hamiltonians  \
    --min-qubits 8    \
    --max-qubits 24   \
    --n-terms 50      \
    --n-terms 100     \
    --min-locality 2  \
    --seed 12345      \
    --csv-out-file csv_files/random_hamiltonian_set.csv \
    --output-dir hdf5_rh_files/

The corresponding .cpp and .hpp file generation is obtained by running again the download dataset command (in this case the download is skipped).

python3 run.py download-datasets \
    --csv-file csv_files/random_hamiltonian_set.csv \
    --download-dir hdf5_rh_files/   \
    --cpp-dir cpp_rh_files          \
    --hpp-dir hpp_rh_files          \
    --skip-download

Download and process HamLib datasets

To download the datasets from HamLib (Sawaya et al., Quantum 2024) run the following scripts. In the case those files has been already downloaded, the download is skipped and only the .cpp and .hpp files are generated. The datasets are listed in the CSV files under csv_files/. The generated .cpp and .hpp files are stored in the cpp_files/ and hpp_files/ directories, respectively. The HDF5 files are stored in the hdf5_files/ directory.

mkdir -p hdf5_files cpp_files hpp_files
python3 run.py download-datasets            \
    --csv-file csv_files/hamlib_hamiltonian_set.csv     \
    --download-dir hdf5_files/              \
    --cpp-dir cpp_files                     \
    --hpp-dir hpp_files                        

Citation

If you use this work, please cite:

@misc{rieger2026hybrid,
      title={Hybrid Method of Efficient Simulation of Physics Applications for a Quantum Computer}, 
      author={Carla Rieger and Albert T. Schmitz and Gehad Salem and Massimiliano Incudini and Sofia Vallecorsa and Anne Y. Matsuura and Michele Grossi and Gian Giacomo Guerreschi},
      year={2026},
      eprint={2602.09020},
      archivePrefix={arXiv},
      primaryClass={quant-ph},
      url={https://arxiv.org/abs/2602.09020}, 
}

About

CFHS: Clifford Fullstate Hybrid Simulation, code accompanying 'Hybrid Method of Efficient Simulation of Physics Applications for a Quantum Computer'.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors