Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert identity to phased xz in qubit characterization #6421

Merged
merged 1 commit into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cirq-core/cirq/experiments/qubit_characterizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,9 @@ def _create_parallel_rb_circuit(
num_moments = max(len(sequence) for sequence in sequences_to_zip)
for q, sequence in zip(qubits, sequences_to_zip):
if (n := len(sequence)) < num_moments:
sequence.extend([ops.SingleQubitCliffordGate.I(q)] * (num_moments - n))
sequence.extend(
[ops.SingleQubitCliffordGate.I.to_phased_xz_gate()(q)] * (num_moments - n)
)
moments = zip(*sequences_to_zip)
return circuits.Circuit.from_moments(*moments, ops.measure_each(*qubits))

Expand Down
6 changes: 3 additions & 3 deletions cirq-core/cirq/experiments/qubit_characterizations_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,12 @@ def test_tomography_plot_raises_for_incorrect_number_of_axes():


def test_single_qubit_cliffords_gateset():
qubit = GridQubit(0, 0)
qubits = [GridQubit(0, i) for i in range(4)]
clifford_group = cirq.experiments.qubit_characterizations._single_qubit_cliffords()
c = cirq.experiments.qubit_characterizations._create_parallel_rb_circuit(
(qubit,), 3, clifford_group.c1_in_xy
qubits, 5, clifford_group.c1_in_xy
)
device = cirq.testing.ValidatingTestDevice(
qubits=(qubit,), allowed_gates=(cirq.ops.PhasedXZGate, cirq.MeasurementGate)
qubits=qubits, allowed_gates=(cirq.ops.PhasedXZGate, cirq.MeasurementGate)
)
device.validate_circuit(c)
Loading