#! /bin/sh # # generate plot from bj.sh results echo "Creating data/bj.txt and data/bj.gif" n=8; t=8 octave="/usr/bin/octave-cli -q --traditional" for m in $(seq 8 17) do f="data/$n-$m-$t.txt" Q=$(tail -n 1 "$f" | awk '{ gsub(/,/," "); print $7 }') # 1-pt M=$(head -n 1 "$f" | awk '{ gsub(/,/," "); print lshift(1,$7); }') # 2**m C=$($octave --eval "fprintf(\"%g\",1-bj($M)); exit") echo "$M $C $Q" done > data/bj.txt title="estimation error probability vs. sample size" xlabel="number of samples" ylabel="error probability" labels="set logscale xy\nset title \"$title\"\nset xlabel \"$xlabel\"\nset ylabel \"$ylabel\"" labels="$labels\nset xrange [256:131072]" printf "set term gif\nset output\n$labels\nset key right top\nplot\ 'data/bj.txt' using 1:2 with linespoints lc rgb 'red' title 'classical',\ 'data/bj.txt' using 1:3 with linespoints lc rgb 'blue' title 'quantum'\n" | gnuplot > data/bj.gif