pyGSTi icon indicating copy to clipboard operation
pyGSTi copied to clipboard

Serialization of PlaquetteGridCircuitStructure is incorrect if fiducial pair reduction is True

Open eendebakpt opened this issue 1 year ago • 0 comments

Describe the bug

To perform the GST measurements and analysis independently I tried to serialize the relevant structures after measurment, and then load the same structures later for analysis. This fails for the PlaquetteGridCircuitStructure

To Reproduce

A minimal example:

import pygsti
from pygsti.modelpacks import smq1Q_XY, smq2Q_XYCPHASE
import tempfile
import os
from pygsti.circuits.circuitstructure import PlaquetteGridCircuitStructure
import tempfile

model_pack = smq2Q_XYCPHASE
exp_design = model_pack.create_gst_experiment_design( max_max_length=[1,2], fpr=True)
       
experiment_list = exp_design.all_circuits_needing_data
f = tempfile.mktemp(suffix='.json')
experiment_list.write(f)

with open(f,  'r') as fid:
        experiment_list2=PlaquetteGridCircuitStructure.load(fid)
        
print(experiment_list[0])
print(experiment_list2[0])

Has output

Qubit 0 -----
Qubit 1 -----

Qubit 0 ---|     |-|     |-|     |-|     |---
Qubit 1 ---|Gypi2|-|Gxpi2|-|Gxpi2|-|Gxpi2|---

The issue does not occur then fpr is set to False.

Expected behavior

The two printed circuits should be identical. In particular, the deserialized object should be identical to the original object (in all aspects that are relevant for running GST). The same problem occurs when using the PlaquetteGridCircuitStructure.to_nice_serialization.

Environment (please complete the following information):

  • pyGSTi version [e.g. v0.9.7.4]: 0.9.12.3
  • python version [e.g. 3.7, 2.7]: 3.10
  • OS [e.g. OSX 10.14, Ubuntu 16.04 LTS] Windows

Additional context Add any other context about the problem here.

eendebakpt avatar Sep 13 '24 19:09 eendebakpt