This repository is maintained by Kyano Levi and Daniel Miller (AG Eisert, FU Berlin).
In the preprint Hardware-Tailored Diagonalization Circuits, Daniel Miller et al. developed a theoretical framework for the construction of hardware-tailored readout circuits. The original implementation of the accompanying algorithms is not publically available. However, the working principle of the grouping algorithms are precisely described in Sec. II of the supplementary material. This enabled us to reimplement an open-source version of one of the algorithms. Specifically, in this GitHub repository, we implement a modified version of the the algorithm based on the "numerical solver" described in Sec. II D of the supplementary material.
This repository contains a C++ implementation of the algorithm that relies on the Mixed Integer Quadratically Constrained Program (MIQCP). Our implementation leverages Gurobi, a commercially available software with special offers for academics.
Furthermore, this project includes C++ code for dealing with matrices, undirected graphs, Pauli operators, Clifford circuits and more.
This library is distributed under the MIT License.
If you want to support work like this, please cite our paper: arXiv.2203.03646
- Gurobi >= 10.0.0
- Qiskit >= 0.36.0
- Numpy >= 1.22
The code has only been tested on Windows.
This is a quick setup guide for users that are somewhat familar with C++ development. Check out the full installation guide for detailed step-by-step information on how to setup this code.
A recent C++ compiler version is needed, supporting the C++20 standard. We highly recommend using Visual Studio 2019 or 2022 (not to be confused with Visual Studio Code).
- Check that you have Gurobi installed and registered a valid license.
- Download or clone this repository.
- Run CMake at repository level, configure, generate and open project.
- The grouper algorithm can be found and run from the
grouper
sub-project.
We have prepared a jupyter notebook to guide you through the workflow: data/WorkflowExample.ipynb
Below, we showcase a benchmark of HT-Grouper carried out on a standard laptop (Windows Intel i7, 8th generation, 8 threads). The code was executed in release mode (fast option).
The benchmarked Hamiltonians describe
- (bright green) all subgraphs --> exponential runtime
- (medium bright green) 10k subgraphs --> polynomial runtime
- (medium dark green) 1k subgraphs --> polynomial runtime
- (dark green) 100 subgraphs --> polynomial runtime
As expected, the estimated shot reduction lies between the grouping result of Sorted Insertion with general commutativity (red), which requires all-to-all connectivity, and Sorted Insertion with qubit-wise commutativity (blue), which only requires single-qubit Clifford gates at the readout stage.
Here, we did not fully explore the tradeoff between runtime and quality: For example, for 24 qubits and 14905 Paulis (12 hydrogen atoms), the HT-grouper with 100 random subgraphs required less than 35 minutes to terminate. However, the resulting estimated shot reduction is 12.4 (still better than blue), which can likely be improved by re-running the HT-Grouper with an increased number of subgraphs.