This was written as a term project for Rutgers ECE 451 Introduction to Parallel and Distributed Programming while researching quantum stabilizer codes and circuits. It is based off the CHP code written by Scott Aaronson.
chp_simd.cpp
uses Intel Intrinsics and AVX-512 to accelerate some large-bitwise operations and was shown to have positive scaling for moderate number of qubits (1,000) and negative for large number of qubits (10,000).
This negative scaling comes from the wasted memory throughput as this direct SIMD translation fetches the specific column bit of every row during gate application. A possible improvement, but out of scope for this term project, was to manage swapping between column-major and row-major alignment so that gate application could be vectorized across the tableau column instead of row by row.
chp.c
is a monolithic file and has extra functionality that was left untranslated (printstate
, gaussian
, seed
, of note)
chp_simd.cpp
uses modern C++ convention and splits the code into gates.h
, gates.cpp
, quantum.h
, quantum.cpp
, tableau.h
, and tableau.cpp
.
This was done on the two circuits rand.chp
and rand2.chp
, both generated by Scott Aaronson's included code randqc.c
.
The binaries are not included but were compiled with the following g++/gcc arguments
g++ -o ./bin/chp_simd ./src/chp_simd.cpp -O3 -mavx512f -mavx512bw
gcc -o ./bin/chp ./original/chp.c -O3
They can be run with the following example which assumes CHP files are located inside ./circuit
where -t
is the timing flag:
./bin/chp_simd -t test.chp
The original needs the directory so it can be run with the following:
./bin/chp -t ./circuits/rand.chp
- Steven Nguyen
[2] Gidney, Craig. “Stim: a fast stabilizer circuit simulator.” arXiv:2103.02202 [quant-ph], 2021