forked from watermarkhu/qsurface
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_thresplot.py
39 lines (32 loc) · 1.75 KB
/
run_thresplot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'''
2020 Mark Shui Hu, QuTech
www.github.com/watermarkhu/oop_surface_code
_____________________________________________
'''
import argparse
from run_oopsc import add_args, add_kwargs
from oopsc.threshold.plot import plot_thresholds
if __name__ == "__main__":
parser = argparse.ArgumentParser(
prog="threshold_fit",
description="fit a threshold computation",
usage='%(prog)s [-h/--help] file_name'
)
arguments = [["file_name", "store", str, "file name of csv data (without extension)", "file_name", dict()]]
key_arguments = [
["-p", "--probs", "store", "p items to plot - verbose list", dict(type=float, nargs='*', metavar="")],
["-l", "--latts", "store", "L items to plot - verbose list", dict(type=float, nargs='*', metavar="")],
["-ma", "--modified_ansatz", "store_true", "use modified ansatz - toggle", dict()],
["-o", "--output", "store", "output file name", dict(type=str, default="", metavar="")],
["-pt", "--plot_title", "store", "plot filename", dict(type=str, default="", metavar="")],
["-ymin", "--ymin", "store", "limit yaxis min", dict(type=float, default=0.5, metavar="")],
["-ymax", "--ymax", "store", "limit yaxis max", dict(type=float, default=1, metavar="")],
["-ttf", "--time_to_failure", "store_true", "time to failure axis", dict()],
["-acc", "--accuracy", "store", "grid accuracy", dict(type=float, default=0.025, metavar="")],
["-pn", "--pn", "store", "Network noise", dict(type=float, default=None, metavar="")],
["-lde", "--lde", "store", "lde_success", dict(type=float, default=None, metavar="")]
]
add_args(parser, arguments)
add_kwargs(parser, key_arguments)
args=vars(parser.parse_args())
plot_thresholds(**args)