Skip to content

Commit

Permalink
convert identity to phased xz in qubit characterization (#6421)
Browse files Browse the repository at this point in the history
  • Loading branch information
NoureldinYosri authored Jan 19, 2024
1 parent 91c3f45 commit ba4c6aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
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)

0 comments on commit ba4c6aa

Please sign in to comment.