fixed typo in README.txt; added line for randominputcommutingHermitianPauli2 in Makefile
[strong_simulation_stabilizer_rank.git] / README.txt
1 Strong simulation of multi-Pauli measurements using minimal stabilizer state decompositions
2 -------------------------------------------------------------------------------------------
3
4 BUILD:
5
6 1. We start with the code that scales quadratically with stabilizer rank because it calculates expectation values to zero relative error. Build code for stabilizer rank tensor multiple you'd like to use. Here we choose k=6.
7 $ cp strongsim6.c strongsim.c
8 $ make strongsim
9
10 2. Now we build the code that scales linearly with stabilizer rank because it calculates expectation values to non-zero relative error. Build code for stabilizer rank tensor multiple you'd like to use. Here we choose k=6.
11 $ cp strongsim6_relerr.c strongsim_relerr.c
12 $ make strongsim_relerr
13
14 3. This produces libraries (*.so) of core functions like SHRINK, INNERPRODUCT, EXTEND, etc. since you might want to use them in other code. This means we need to put them somewhere the linker can find them. Follow 3a) for a temporary and easy method that will only be valid for the current shell session and follow 3b) for a persistent method that requires root access.
15 3a) Update LD_LIBRARY_PATH to see the library:
16 $ export LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH
17 or
18 3b) If you have root privileges put the *so library /usr/local/lib or whatever library directory in your path. Then, use ldconfig to write the path in the config file:
19 $ sudo cp ./*so /usr/local/lib
20 $ sudo echo "/usr/local/lib" >> /etc/ld.so.conf
21 $ sudo ldconfig
22
23 4. Build code for generating random commuting Pauli inputs (necessary for the strongsim[1-12]_relerr.c code since it requires a Hermitian observable to get away with using the square root number of stabilizer states).
24 $ make randominputcommutingHermitianPauli2
25
26 5. Build code for generating random (non-commuting) Pauli inputs (good enough for the strongsim[1-12].c code).
27 $ make randominputPauli
28
29 6. Build Hilbert vector space code to check our results.
30 $ make multipauli
31
32
33 TEST CODE:
34 1. Run test diagonositic for strongsim.c (zero relative error).
35 $ bash ./test.bash
36
37 2. Run test diagonositic for strongsim_relerr.c (non-zero relative error).
38 $ bash ./test2.bash
39
40
41
42 Details of source code files:
43
44 strongsim[1-12]_relerror.c takes one argument of the number of stabilizer states to sample and then takes stdin arguments for the number of qubits, t-gate magic states and then the Paulis
45
46 strongsim[1-12]_relerror.c scale linearly with the stabilizer rank and calculate up to finite relative error while strongsim[1-12].c scale quadratically with the stabilizer rank and calculate up to zero relative error.
47
48 strongsim*c need Pauli measurement inputs (with the associated phases) which can be randomly generated with randominputPauli.c and the output from strongsim*c can be verified with multipauli.c
49
50 strongsim[1-12]_relerror.c need commuting Pauli measurement inputs (with the associated phasese) which can be randomly generated with randominputcommutingHermitianPauli2.c and can be verified with multipauli.c
51
52 randominputcommutingHermitianPauli.c uses a brute-force random sampling of the commuting Paulis whereas *2.c uses random Clifford operations on initially separable Paulis to generate the commuting Paulis. *2.c is the only practically viable method for more than 30 Paulis on a desktop computer.
53
54 NOTE: current strongsim*c only support the same number of T gates as number of qubits!
55
56 Pd.txt is a tabulated list of P(d) values for strongsim[1-12]_relerror.c.