2 # simple Bash script to check if stabilizer rank code works
4 # choose the number of qubits and T gates on those qubits
5 # NOTE: numqubits must be a multiple of your gauss sum tensor multiple!
6 # e.g. if you test gausssums_multipleof6 then numqubits=6*n for some integer n
12 echo "Starting test of $numruns random $numqubits-Pauli expectation values..."
13 for i in $(seq 1 $numruns)
15 # sleep for 1 second for the pseudorandom number generator
16 sleep 1;a=$(stdbuf -oL ./randominputPauli $numqubits $numTgates > inputfullPauli.txt && ./strongsim < inputfullPauli.txt | tail -1)
17 b=$(stdbuf -oL ./multipauli < inputfullPauli.txt | tail -n1)
18 are=$(echo "$a" | cut -f 1 -d " " | cut -c 1-5);
19 aim=$(echo "$a" | cut -f 3 -d " " | cut -c 1-5); aimsign=$(echo $a | cut -f 2 -d " "); bimsign=$(echo $b | cut -f 2 -d " ");
21 bre=$(echo "$b" | cut -f 1 -d " " | cut -c 1-5);
22 bim=$(echo "$b" | cut -f 3 -d " " | cut -c 1-5); echo "$i: $are $aimsign $aim and $bre $bimsign $bim"
23 if [ "$are" == "$bre" ] && [ "$aim" == "$bim" ] && [ "$aimsign" == "$bimsign" ]