Skip to content

Commit f80b42c

Browse files
authored
Merge branch 'master' into appease-shellcheck
2 parents 6e8f539 + c875124 commit f80b42c

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

cirq-google/cirq_google/calibration/phased_fsim_test.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
import os
15-
import re
1615

1716
from typing import cast
1817
from unittest import mock
@@ -223,12 +222,14 @@ def test_floquet_to_calibration_layer_with_measure_qubits():
223222

224223
def test_xeb_to_calibration_layer():
225224
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)
227226
request = XEBPhasedFSimCalibrationRequest(
228227
gate=gate,
229228
pairs=((q_00, q_01), (q_02, q_03)),
230229
options=XEBPhasedFSimCalibrationOptions(
231230
n_library_circuits=22,
231+
fatol=0.0078125,
232+
xatol=0.0078125,
232233
fsim_options=XEBPhasedFSimCharacterizationOptions(
233234
characterize_theta=True,
234235
characterize_zeta=True,
@@ -246,8 +247,8 @@ def test_xeb_to_calibration_layer():
246247
'n_library_circuits': 22,
247248
'n_combinations': 10,
248249
'cycle_depths': '5_25_50_100_200_300',
249-
'fatol': 5e-3,
250-
'xatol': 5e-3,
250+
'fatol': 0.0078125,
251+
'xatol': 0.0078125,
251252
'characterize_theta': True,
252253
'characterize_zeta': True,
253254
'characterize_chi': False,
@@ -267,8 +268,6 @@ def test_xeb_to_calibration_layer():
267268
desired_textproto = f.read()
268269

269270
layer_str = str(new_layer)
270-
# Fix precision issues
271-
layer_str = re.sub(r'0.004999\d+', '0.005', layer_str)
272271
assert layer_str == desired_textproto
273272

274273

cirq-google/cirq_google/calibration/test_data/xeb_calibration_layer.textproto

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ layer {
1212
qubit_constant_index: 1
1313
fsimgate {
1414
theta {
15-
float_value: 0.7853981852531433
15+
float_value: 0.75
1616
}
1717
phi {
1818
float_value: 0.0
@@ -24,7 +24,7 @@ layer {
2424
qubit_constant_index: 3
2525
fsimgate {
2626
theta {
27-
float_value: 0.7853981852531433
27+
float_value: 0.75
2828
}
2929
phi {
3030
float_value: 0.0
@@ -106,7 +106,7 @@ args {
106106
key: "fatol"
107107
value {
108108
arg_value {
109-
float_value: 0.005
109+
float_value: 0.0078125
110110
}
111111
}
112112
}
@@ -130,7 +130,7 @@ args {
130130
key: "xatol"
131131
value {
132132
arg_value {
133-
float_value: 0.005
133+
float_value: 0.0078125
134134
}
135135
}
136136
}

0 commit comments

Comments
 (0)