From 7e7ffbb8eaea348445ae439e27c12a3a312443f7 Mon Sep 17 00:00:00 2001 From: Brad Chase Date: Thu, 13 Feb 2025 15:25:55 -0500 Subject: [PATCH] Address PR comments --- benchmarks/scripts/common.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/benchmarks/scripts/common.py b/benchmarks/scripts/common.py index 0a76c18..d5729f5 100644 --- a/benchmarks/scripts/common.py +++ b/benchmarks/scripts/common.py @@ -113,8 +113,8 @@ def qiskit_compile(qiskit_circuit): class BenchmarkTargetGateset(cirq.TwoQubitCompilationTargetGateset): """Target gateset for compiling circuits for benchmarking. - This is modeled off cirq's CZCompilationTargetGateset, but instead: - * Decomposes single-qubit gates into Rz, Ry, and Rz gates versus XZPowGate. + This is modeled off cirq's `CZCompilationTargetGateset`_, but instead: + * Decomposes non target gateset single-qubit gates into Rz, Ry gates versus XZPowGate. * Decomposes two-qubit gates into CNOT gates versus CZPowGate. * Overrides the base classes postprocess_transformers to eliminate the merge_single_qubit_moments_to_phxz pass to avoid re-introducing XZPowGates. @@ -123,6 +123,8 @@ class BenchmarkTargetGateset(cirq.TwoQubitCompilationTargetGateset): * Single-Qubit Gates: `cirq.H`, `cirq.Rx`, `cirq.Ry`, `cirq.Rz`. * Two-Qubit Gates: `cirq.CNOT` * `cirq.MeasurementGate` + + .. _CZCompilationTargetGateset: https://github.com/quantumlib/Cirq/blob/dd3df78c045a03b2de70b2d54d8582abbfc1f6c2/cirq-core/cirq/transformers/target_gatesets/cz_gateset.py#L27 """ def __init__(self): @@ -138,7 +140,7 @@ def __init__(self): ) def _decompose_single_qubit_operation( - self, op: cirq.Operation, _ + self, op: cirq.Operation, moment_idx: int ) -> cirq.OP_TREE: if not cirq.protocols.has_unitary(op): return NotImplemented