From d33b1a71ac9721e762a2fa1b9e9871edfe187a3c Mon Sep 17 00:00:00 2001 From: Matthew Neeley Date: Thu, 21 Dec 2023 18:38:45 +0000 Subject: [PATCH] Don't create a new list of qubits in Gate.on (#6390) Review: @dabacon --- cirq-core/cirq/ops/raw_types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cirq-core/cirq/ops/raw_types.py b/cirq-core/cirq/ops/raw_types.py index 7739f2d268e..18fe6e22fc5 100644 --- a/cirq-core/cirq/ops/raw_types.py +++ b/cirq-core/cirq/ops/raw_types.py @@ -230,7 +230,7 @@ def on(self, *qubits: Qid) -> 'Operation': Returns: a `cirq.Operation` which is this gate applied to the given qubits. """ - return ops.gate_operation.GateOperation(self, list(qubits)) + return ops.gate_operation.GateOperation(self, qubits) def on_each(self, *targets: Union[Qid, Iterable[Any]]) -> List['cirq.Operation']: """Returns a list of operations applying the gate to all targets.