-
Notifications
You must be signed in to change notification settings - Fork 0
/
PE_1freq_simplex_200_plot.py
executable file
·57 lines (43 loc) · 1.48 KB
/
PE_1freq_simplex_200_plot.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Script for generating a plot of gate error (data included in file)
"""
import os
import sys
import matplotlib
matplotlib.use('Agg')
from notebook_utils import get_stage2_table, PlotGrid
from QDYN.memoize import memoize
STYLE = 'slides.mplstyle'
def create_figure(outfile, table):
plots = PlotGrid(publication=True)
plots.add_cell(table['w2 [GHz]'], table['wc [GHz]'], table['C'],
vmin=0.0, vmax=1.0, contour_levels=11,
title='concurrence')
plots.add_cell(table['w2 [GHz]'], table['wc [GHz]'], table['max loss'],
vmin=0.0, vmax=1.0,
contour_levels=11,
title='max. pop. loss')
# output
fig = plots.plot(quiet=True, show=False, style=STYLE)
fig.savefig(outfile, format=os.path.splitext(outfile)[1][1:])
@memoize
def read_data():
category = '1freq_center'
full_table = get_stage2_table('./runs_200_RWA')
(__, t_PE), (__, t_SQ) = full_table.groupby('target', sort=True)
target_table = t_PE
table_grouped = target_table.groupby('category')
return table_grouped.get_group(category)
def main(argv=None):
if argv is None:
argv = sys.argv
basename = os.path.splitext(__file__)[0]
outfile = basename + '.png'
read_data.load(basename + '.cache')
table = read_data()
read_data.dump(basename + '.cache')
create_figure(outfile, table)
if __name__ == "__main__":
sys.exit(main())