# How to create an LGST-only report¶

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.

In [1]:
#Import the pygsti module (always do this) and the standard XYI model
import pygsti
from pygsti.modelpacks import smq1Q_XYI

#Get experiment design (for now, just max_max_length=1 GST sequences)
exp_design = smq1Q_XYI.get_gst_experiment_design(max_max_length=1)
pygsti.io.write_empty_protocol_data(exp_design, "example_files/lgst_only_example", clobber_ok=True)
print("Only %d sequences are required!" % len(exp_design.all_circuits_needing_data))

#Simulate taking the data (here you'd really fill in dataset.txt with actual data)
mdl_datagen = smq1Q_XYI.target_model().depolarize(op_noise=0.1, spam_noise=0.001)
pygsti.io.fill_in_empty_dataset_with_fake_data(mdl_datagen, "example_files/lgst_only_example/data/dataset.txt",
nSamples=1000, seed=2020)


Only 92 sequences are required!

In [2]:
#Run LGST and create a report
# You can also eliminate gauge optimization step by setting gaugeOptParams=False
results = pygsti.protocols.LGST().run(data)

--- LGST ---
Singular values of I_tilde (truncating to first 4 of 6) =
4.243739384333438
1.174085597747583
0.9927915010167846
0.9182042113995429
0.0731735967798496
0.032353259963406746

Singular values of target I_tilde (truncating to first 4 of 6) =
4.242640687119284
1.4142135623730956
1.4142135623730954
1.4142135623730951
2.5394445830714747e-16
1.118988490269554e-16


WARNING: Treating result as *converged* after maximum iterations (100) were exceeded.

In [3]:
pygsti.report.construct_standard_report(
results, title="LGST-only Example Report", verbosity=2
).write_html('example_files/LGSTonlyReport', verbosity=2)

Running idle tomography
Computing switchable properties
Found standard clifford compilation from smq1Q_XYI


Click to open the file example_files/LGSTonlyReport/main.html in your browser to view the report.