We're celebrating World Quantum Day 2022! Join us

cirq.neutral_atoms.NeutralAtomGateset

A Compilation target intended for neutral atom devices.

Inherits From: CompilationTargetGateset, Gateset

This gateset supports CNOT, CCNOT (TOFFOLI) gates, CZ, CCZ gates, as well as single qubits gates that can be used in a parallel fashion. The maximum amount of parallelism can be set by arguments.

This compilation gateset decomposes operations into CZ because CZ gates are the highest fidelity two qubit gates for neutral atoms.

max_parallel_z The maximum amount of parallelism for Z gates.
max_parallel_xy The maximum amount of parallelism for X, Y and PhasedXPow gates.

gates

name

postprocess_transformers List of transformers which should be run after decomposing individual operations.
preprocess_transformers List of transformers which should be run before decomposing individual operations.

Methods

decompose_to_target_gateset

View source

Method to rewrite the given operation using gates from this gateset.

Args
op cirq.Operation to be rewritten using gates from this gateset.
moment_idx Moment index where the given operation op occurs in a circuit.

Returns

  • An equivalent cirq.OP_TREE implementing op using gates from this gateset.
  • None or NotImplemented if does not know how to decompose op.

num_qubits

View source

Maximum number of qubits on which a gate from this gateset can act upon.

validate

View source

Validates gates forming circuit_or_optree should be contained in Gateset.

Args
circuit_or_optree The cirq.Circuit or cirq.OP_TREE to validate.

with_params

View source

Returns a copy of this Gateset with identical gates and new values for named arguments.

If a named argument is None then corresponding value of this Gateset is used instead.

Args
name New name for the Gateset.
unroll_circuit_op If True, new Gateset will recursively validate cirq.CircuitOperation by validating the underlying cirq.Circuit.
accept_global_phase_op If True, a GateFamily accepting cirq.GlobalPhaseGate will be included. If None, cirq.GlobalPhaseGate will not modify the input *gates. If False, cirq.GlobalPhaseGate will be removed from the gates. This parameter defaults to None (a breaking change from v0.14.1) and will be removed in v0.16.

Returns
self if all new values are None or identical to the values of current Gateset. else a new Gateset with identical gates and new values for named arguments.

__contains__

View source

Check for containment of a given Gate/Operation in this Gateset.

Containment checks are handled as follows: a) For Gates or Operations that have an underlying gate (i.e. op.gate is not None):

    - Forwards the containment check to the underlying <a href="../../cirq/ops/GateFamily"><code>cirq.GateFamily</code></a> objects.
    - Examples of such operations include `cirq.GateOperations` and their controlled
        and tagged variants (i.e. instances of <a href="../../cirq/ops/TaggedOperation"><code>cirq.TaggedOperation</code></a>,
        <a href="../../cirq/ops/ControlledOperation"><code>cirq.ControlledOperation</code></a> where `op.gate` is not None) etc.

b) For Operations that do not have an underlying gate:

    - Forwards the containment check to `self._validate_operation(item)`.
    - Examples of such operations include `cirq.CircuitOperations` and their controlled
        and tagged variants (i.e. instances of <a href="../../cirq/ops/TaggedOperation"><code>cirq.TaggedOperation</code></a>,
        <a href="../../cirq/ops/ControlledOperation"><code>cirq.ControlledOperation</code></a> where `op.gate` is None) etc.

The complexity of the method in terms of the number of gates, n, is a) O(1) when any default cirq.GateFamily instance accepts the given item, except for an Instance GateFamily trying to match an item with a different global phase. b) O(n) for all other cases: matching against custom gate families, matching across global phase for the default Instance GateFamily, no match against any underlying gate family.

Args
item The cirq.Gate or cirq.Operation instance to check containment for.

__eq__

View source

__ne__

View source