This example shows how you can create a HTML report from just the results of running linear GST (LGST). This can be useful when you want to get a rough estimate of your gates quickly, as LGST is takes substantially less data and computation time compared with long-sequence GST. This example is modeled after Tutorial 0.
#Make print statements compatible with Python 2 and 3
from __future__ import print_function
#Import the pygsti module (always do this) and the standard XYI gate set
import pygsti
from pygsti.construction import std1Q_XYI
# 1) get the target GateSet
gs_target = std1Q_XYI.gs_target
# 2) get the building blocks needed to specify which gate sequences are needed
prep_fiducials, meas_fiducials = std1Q_XYI.prepStrs, std1Q_XYI.effectStrs
# 3) generate "fake" data from a depolarized version of gs_target
gs_datagen = gs_target.depolarize(gate_noise=0.1, spam_noise=0.001)
listOfExperiments = pygsti.construction.list_lgst_gatestrings(
prep_fiducials, meas_fiducials,gs_target)
ds = pygsti.construction.generate_fake_data(gs_datagen, listOfExperiments, nSamples=1000,
sampleError="binomial", seed=1234)
#Note: from listOfExperiments we can also create an empty dataset file
# which has columns of zeros where actual data should go.
pygsti.io.write_empty_dataset("example_files/LGSTReportDataTemplate.txt", listOfExperiments,
"## Columns = 0 count, 1 count")
# After replacing the zeros with actual data, the data set can be
# loaded back into pyGSTi using the line below and used in the rest
# of this tutorial.
#ds = pygsti.io.load_dataset("example_files/LGSTReportDataTemplate.txt")
print("Only %d sequences are required!" % len(listOfExperiments))
#Run LGST and create a report
# You can also eliminate gauge optimization step by setting gaugeOptParams=False
results = pygsti.do_linear_gst(ds, gs_target, prep_fiducials, meas_fiducials)
pygsti.report.create_standard_report(results, filename="example_files/LGSTonlyReport",
title="LGST-only Example Report", verbosity=2)
Click to open the file example_files/LGSTonlyReport/main.html in your browser to view the report.