@@ -118,6 +118,38 @@ def test_floquet_to_calibration_layer():
118
118
'est_gamma' : False ,
119
119
'est_phi' : True ,
120
120
'readout_corrections' : True ,
121
+ 'version' : 2 ,
122
+ },
123
+ )
124
+
125
+
126
+ def test_floquet_to_calibration_layer_with_version_override ():
127
+ q_00 , q_01 , q_02 , q_03 = [cirq .GridQubit (0 , index ) for index in range (4 )]
128
+ gate = cirq .FSimGate (theta = np .pi / 4 , phi = 0.0 )
129
+ request = FloquetPhasedFSimCalibrationRequest (
130
+ gate = gate ,
131
+ pairs = ((q_00 , q_01 ), (q_02 , q_03 )),
132
+ options = FloquetPhasedFSimCalibrationOptions (
133
+ characterize_theta = True ,
134
+ characterize_zeta = True ,
135
+ characterize_chi = False ,
136
+ characterize_gamma = False ,
137
+ characterize_phi = True ,
138
+ version = 3 ,
139
+ ),
140
+ )
141
+
142
+ assert request .to_calibration_layer () == cirq_google .CalibrationLayer (
143
+ calibration_type = 'floquet_phased_fsim_characterization' ,
144
+ program = cirq .Circuit ([gate .on (q_00 , q_01 ), gate .on (q_02 , q_03 )]),
145
+ args = {
146
+ 'est_theta' : True ,
147
+ 'est_zeta' : True ,
148
+ 'est_chi' : False ,
149
+ 'est_gamma' : False ,
150
+ 'est_phi' : True ,
151
+ 'readout_corrections' : True ,
152
+ 'version' : 3 ,
121
153
},
122
154
)
123
155
@@ -150,6 +182,41 @@ def test_floquet_to_calibration_layer_readout_thresholds():
150
182
'readout_corrections' : True ,
151
183
'readout_error_tolerance' : 0.4 ,
152
184
'correlated_readout_error_tolerance' : 7 / 6 * 0.4 - 1 / 6 ,
185
+ 'version' : 2 ,
186
+ },
187
+ )
188
+
189
+
190
+ def test_floquet_to_calibration_layer_with_measure_qubits ():
191
+ qubits = tuple (cirq .GridQubit (0 , index ) for index in range (5 ))
192
+ q_00 , q_01 , q_02 , q_03 , _ = qubits
193
+ gate = cirq .FSimGate (theta = np .pi / 4 , phi = 0.0 )
194
+ request = FloquetPhasedFSimCalibrationRequest (
195
+ gate = gate ,
196
+ pairs = ((q_00 , q_01 ), (q_02 , q_03 )),
197
+ options = FloquetPhasedFSimCalibrationOptions (
198
+ characterize_theta = True ,
199
+ characterize_zeta = True ,
200
+ characterize_chi = False ,
201
+ characterize_gamma = False ,
202
+ characterize_phi = True ,
203
+ measure_qubits = qubits ,
204
+ ),
205
+ )
206
+
207
+ assert request .to_calibration_layer () == cirq_google .CalibrationLayer (
208
+ calibration_type = 'floquet_phased_fsim_characterization' ,
209
+ program = cirq .Circuit (
210
+ [gate .on (q_00 , q_01 ), gate .on (q_02 , q_03 ), cirq .measure (* qubits )],
211
+ ),
212
+ args = {
213
+ 'est_theta' : True ,
214
+ 'est_zeta' : True ,
215
+ 'est_chi' : False ,
216
+ 'est_gamma' : False ,
217
+ 'est_phi' : True ,
218
+ 'readout_corrections' : True ,
219
+ 'version' : 2 ,
153
220
},
154
221
)
155
222
0 commit comments