sandialabs / pyGSTi

A python implementation of Gate Set Tomography
http://www.pygsti.info
Apache License 2.0
133 stars 56 forks source link

Interleaved RB #468

Closed coreyostrove closed 1 month ago

coreyostrove commented 1 month ago

This PR adds first party support for interleaved randomized benchmarking (as described in the original 2012 paper from Magesan et al. https://arxiv.org/pdf/1203.4550) to the RB codebase. The analysis for IRB is incredibly simple, so from an implementation standpoint much of what has been added is aimed at streamlining the experiment design construction process, automating this analysis, and creating data structures for keeping the two relevant subexperiments stored together.

Specifically I have added the following:

  1. InterleavedRBDesign: This class both performs the creation of the two subexperiment designs (a standard CRB experiment and one with a target gate interleaved between random cliffords) and acts as a container for these two experiment designs. This subclasses off of CombinedExperimentDesign which allows for use to index into each of the subdesigns as well as interact with them jointly (getting the combined all_circuits_needing_data value at data collection time, for example).
  2. InterleavedRandomizedBenchmarking: This is a new protocol class which farms off the RB estimation for each of the subexperiments to RandomizedBenchmarking and then extracts the relevant results for calculating the IRB numbers and bounds. This returns a ProtocolResultsDir containing the IRB specific results along with the full results for each of the subexperiments.
  3. InterleavedRandomizedBenchmarkingResults: This is a simple (mostly data) class for storing the IRB results at the top node of the aforementioned ProtocolResultsDir.

Aside from the code described above I have also added a new section to the Clifford RB tutorial notebook demonstrating the use of the new functionality. Also included are new unit tests, both for the IRB features added and for improving testing coverage on existing parts RB (particularly with regards to serialization). Lastly, there is a bug fix for a reported issue where serialization of CliffordRBDesign was failing when constructed using the (previously undocumented) interleaved_circuit kwarg.

Big thanks go out to @jordanh6 and @enielse for their valuable advice in the achitecting of these additions, and to @jordanh6 and @tjproct for their guidance on the IRB theory.