X-Git-Url: https://s3miclassical.com/gitweb/?p=strong_simulation_stabilizer_rank.git;a=blobdiff_plain;f=test2.bash;h=e6b3122464520df26dd6603db7924aba99a7efc6;hp=d5ed86872e9cfaf23aa5387bb0b4535051c1e0e0;hb=bce2108bbb4eada26cfe1561a5f0b06528ab470c;hpb=f36d60f8c85e0879a7d2b52e816638d2b4fdf86a diff --git a/test2.bash b/test2.bash index d5ed868..e6b3122 100644 --- a/test2.bash +++ b/test2.bash @@ -26,17 +26,23 @@ do sleep 1; a=$(stdbuf -oL ./randominputcommutingHermitianPauli2 $numqubits $numTgates $numPaulis > inputPauli.txt && ./strongsim_relerr $numsamples < inputPauli.txt | tail -1) b=$(stdbuf -oL ./multipauli < inputPauli.txt | tail -n1) are=$(echo "$a" | cut -f 1 -d " " | cut -c 1-5); -aim=$(echo "$a" | cut -f 3 -d " " | cut -c 1-5); aimsign=$(echo $a | cut -f 2 -d " "); bimsign=$(echo $a | cut -f 2 -d " "); +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 " "); bre=$(echo "$b" | cut -f 1 -d " " | cut -c 1-5); bim=$(echo "$b" | cut -f 3 -d " " | cut -c 1-5); echo "$i: $are $aimsign $aim and $bre $bimsign $bim" rediff=$( printf 'sqrt((%f - %f)^2)\n' "$are" "$bre" | bc -l ) imdiff=$( printf 'sqrt((%f - %f)^2)\n' "$aim" "$bim" | bc -l ) -if (( $(echo "$rediff < $threshold" |bc -l) )) && (( $(echo "$imdiff < $threshold" |bc -l) )) && [ "$aimsign" == "$bimsign" ] +if (( $(echo "$rediff < $threshold" |bc -l) )) && (( $(echo "$imdiff < $threshold" |bc -l) )) then - continue + if (( $(echo "$bim < $threshold" |bc -l) )) || [ "$aimsign" == "$bimsign" ] + then + continue + else + echo "NOTE EQUAL!" + exit + fi else echo "NOT EQUAL!" - break + exit fi done echo "Test passed!"