b=$(stdbuf -oL ./multipauli < inputfullPauli.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 $b | cut -f 2 -d " ");
-echo $aimsign;
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"
if [ "$are" == "$bre" ] && [ "$aim" == "$bim" ] && [ "$aimsign" == "$bimsign" ]
continue
else
echo "NOT EQUAL!"
-break
+exit
fi
done
echo "Test passed!"
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!"