Skip to content

Commit 762dabc

Browse files
coverage
1 parent 3fc08ba commit 762dabc

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

cirq-core/cirq/experiments/z_phase_calibration_test.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,34 @@ def test_calibrate_z_phases_workflow_no_options(pool, angles, error) -> None:
204204
assert 'theta' not in params
205205

206206

207+
@pytest.mark.parametrize(['angles', 'error'], _create_tests(n=3))
208+
def test_calibrate_z_phases_workflow_no_options_no_pool(angles, error) -> None:
209+
original_gate = cirq.PhasedFSimGate(**dict(zip(_ANGLES, angles)))
210+
actual_gate = cirq.PhasedFSimGate(**{k: v + e for k, v, e in zip(_ANGLES, angles, error)})
211+
212+
sampler = _TestSimulator(original_gate, actual_gate, seed=_SEED)
213+
qubits = cirq.q(0, 0), cirq.q(0, 1)
214+
result, _ = z_phase_calibration_workflow(
215+
sampler,
216+
qubits,
217+
original_gate,
218+
options=None,
219+
n_repetitions=1,
220+
n_combinations=1,
221+
n_circuits=1,
222+
cycle_depths=(1, 2),
223+
random_state=_SEED,
224+
num_workers_or_pool=2,
225+
)
226+
227+
for params in result.final_params.values():
228+
assert 'zeta' in params
229+
assert 'chi' in params
230+
assert 'gamma' in params
231+
assert 'phi' not in params
232+
assert 'theta' not in params
233+
234+
207235
def test_plot_z_phase_calibration_result() -> None:
208236
df = pd.DataFrame()
209237
qs = cirq.q(0, 0), cirq.q(0, 1), cirq.q(0, 2)

0 commit comments

Comments
 (0)