Skip to content

Commit

Permalink
Don't create a new list of qubits in Gate.on (#6390)
Browse files Browse the repository at this point in the history
Review: @dabacon
  • Loading branch information
maffoo committed Dec 21, 2023
1 parent 7c9b713 commit d33b1a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cirq-core/cirq/ops/raw_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d33b1a7

Please sign in to comment.