sandialabs / pyGSTi

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

Bugfix Cirq Datasets and LGST Bug #420

Closed coreyostrove closed 2 months ago

coreyostrove commented 2 months ago

This PR covers two bugfixes. The first is in the method for adding cirq trials to pygsti datasets which did not behave as expected for 2+ qubits. The default behavior of the histogram method of the cirq Result object, which is used for gathering aggregated counts for each measurement results is to index these results using integers corresponding to the binary string for an outcome. In pygsti we more commonly use the binary strings themselves as the key. To address this we have added new options to add_cirq_trial_result which controls conversion back to a bit string before adding it to the count dictionary.

The second bugfix was to the LGST routine in order to patch in support for datasets with sparse formats wherein we only include outcomes with non-zero counts in the count dict for a circuit. Previously the implementation assumed that the data set was in a dense format with zero entries listed.