-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
area/gatescomplexity/mediumintroduces/modifies 3-5 concepts, takes max up to a month for an advanced contributorintroduces/modifies 3-5 concepts, takes max up to a month for an advanced contributorkind/deprecationskill-level/advancedOne or more of the areas need a solid understanding.One or more of the areas need a solid understanding.triage/acceptedA consensus emerged that this bug report, feature request, or other action should be worked onA consensus emerged that this bug report, feature request, or other action should be worked on
Description
What is the use of gate_features.TwoQubitGate
(and ThreeQubitGate
, for that matter)? It doesn't define any method other than _num_qubits_
.
The reason I think its existence could potentially be bad comes up when people want to count the number of two-qubit gates in their circuit. They might think to do
circuit.findall_operations_with_gate_type(cirq.TwoQubitGate)
but for this to work properly, every two-qubit gate in their circuit must be of a type explicitly declared to be a TwoQubitGate. I myself am wary of doing this and find myself always using the more sure-fire
circuit.findall_operations(lambda op: isinstance(op, cirq.GateOperation) and len(op.qubits) == 2)
instead.
Metadata
Metadata
Assignees
Labels
area/gatescomplexity/mediumintroduces/modifies 3-5 concepts, takes max up to a month for an advanced contributorintroduces/modifies 3-5 concepts, takes max up to a month for an advanced contributorkind/deprecationskill-level/advancedOne or more of the areas need a solid understanding.One or more of the areas need a solid understanding.triage/acceptedA consensus emerged that this bug report, feature request, or other action should be worked onA consensus emerged that this bug report, feature request, or other action should be worked on