cirq.ParallelGateFamily

GateFamily which accepts instances of cirq.ParallelGate and its sub_gate.

Inherits From: GateFamily

ParallelGateFamily is useful for description and validation of scenarios where multiple copies of a unitary gate can act in parallel. cirq.ParallelGate is used to express such a gate with a corresponding unitary sub_gate that acts in parallel.

ParallelGateFamily supports initialization via:

  • Gate Instances that can be applied in parallel.
  • Gate Types whose instances can be applied in parallel.

In both the cases, the users can specify an additional parameter max_parallel_allowed which is used to verify the maximum number of qubits on which any given gate instance can act on.

To verify containment of a given cirq.Gate instance g, the gate family verfies that:

  • cirq.num_qubits(g) <= max_parallel_allowed if max_parallel_allowed is not None.
  • g or g.sub_gate (if g is an instance of cirq.ParallelGate) is an accepted gate based on type or instance checks depending on the initialization gate type.

gate The gate which can act in parallel. It can be a python type inheriting from cirq.Gate or a non-parameterized instance of a cirq.Gate. If an instance of cirq.ParallelGate is passed, then the corresponding gate.sub_gate is used.
name The name of the gate family.
description Human readable description of the gate family.
max_parallel_allowed The maximum number of qubits on which a given gate g can act on. If None, then any number of qubits are allowed.

description

gate

name

tags_to_accept

tags_to_ignore

Methods

__contains__

View source

__eq__

View source

__ne__

View source