-
Install
uv
.curl -LsSf https://astral.sh/uv/install.sh | sh
-
Install dependencies:
uv sync
-
Build binaries (requires
gcc
). This is only required if you want to use thedegree_c
reordering method.make dll
-
Build the index. This is a SQlite3 file that lists all the Hamiltonian from all the
hdf5
files present in the HamLib website.uv run python -m pcb build-index out/index.db
-
Download the Hamiltonian ZIP files.
uv run python -m pcb download out/index.db out/ham # it is also possible to apply a filter to only download files in a given subdirectory uv run python -m pcb download out/index.db out/ham --prefix binaryoptimization/maxcut
-
Run the benchmark.
uv run python -m pcb benchmark-reorder out/index.db out/ham out/reordering #Â or uv run python -m pcb benchmark-reorder out/index.db out/ham out/reordering --n-jobs 32 --methods none,saturation,misra_gries --prefix binaryoptimization/maxcut
-
You can obtain temporary consolidated results during the benchmark by running:
uv run python -m pcb consolidate out/reordering
This is automatically done at the end of the benchmark.
Once the reordering benchmark is done, you can run the QAOA simulation benchmark to see if reordered circuits produce better ground states (approximations).
-
Run the benchmark.
uv run python -m pcb benchmark-simulate out/ham out/reordering out/simulation #Â or uv run python -m pcb benchmark-simulate out/ham out/reordering out/simulation --n-jobs 8 --methods none,saturation,misra_gries --prefix binaryoptimization/maxcut --max-qubits 8 --max-terms 32 --qaoa-n-shots 1024 --qaoa-n-steps 2 --qaoa-max-iter 128
-
Like for the reordering benchmark, you can obtain temporary consolidated results during the benchmark by running:
uv run python -m pcb consolidate out/simulation
This is automatically done at the end of the benchmark.
uv run python -m pcb --help