12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
import os
15
- import re
16
15
17
16
from typing import cast
18
17
from unittest import mock
@@ -223,12 +222,14 @@ def test_floquet_to_calibration_layer_with_measure_qubits():
223
222
224
223
def test_xeb_to_calibration_layer ():
225
224
q_00 , q_01 , q_02 , q_03 = [cirq .GridQubit (0 , index ) for index in range (4 )]
226
- gate = cirq .FSimGate (theta = np . pi / 4 , phi = 0.0 )
225
+ gate = cirq .FSimGate (theta = 0.75 , phi = 0.0 )
227
226
request = XEBPhasedFSimCalibrationRequest (
228
227
gate = gate ,
229
228
pairs = ((q_00 , q_01 ), (q_02 , q_03 )),
230
229
options = XEBPhasedFSimCalibrationOptions (
231
230
n_library_circuits = 22 ,
231
+ fatol = 0.0078125 ,
232
+ xatol = 0.0078125 ,
232
233
fsim_options = XEBPhasedFSimCharacterizationOptions (
233
234
characterize_theta = True ,
234
235
characterize_zeta = True ,
@@ -246,8 +247,8 @@ def test_xeb_to_calibration_layer():
246
247
'n_library_circuits' : 22 ,
247
248
'n_combinations' : 10 ,
248
249
'cycle_depths' : '5_25_50_100_200_300' ,
249
- 'fatol' : 5e-3 ,
250
- 'xatol' : 5e-3 ,
250
+ 'fatol' : 0.0078125 ,
251
+ 'xatol' : 0.0078125 ,
251
252
'characterize_theta' : True ,
252
253
'characterize_zeta' : True ,
253
254
'characterize_chi' : False ,
@@ -267,8 +268,6 @@ def test_xeb_to_calibration_layer():
267
268
desired_textproto = f .read ()
268
269
269
270
layer_str = str (new_layer )
270
- # Fix precision issues
271
- layer_str = re .sub (r'0.004999\d+' , '0.005' , layer_str )
272
271
assert layer_str == desired_textproto
273
272
274
273
0 commit comments