cirq.GridQubit

class cirq.GridQubit(row: int, col: int)[source]

A qubit on a 2d square lattice.

GridQubits use row-major ordering:

GridQubit(0, 0) < GridQubit(0, 1) < GridQubit(1, 0) < GridQubit(1, 1)
__init__(row: int, col: int)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

from_diagram(diagram)
Parse ASCII art device layout into info about qubits and
from_proto_dict(proto_dict) Proto dict must have ‘row’ and ‘col’ keys.
is_adjacent(other) Determines if two qubits are adjacent qubits.
proto_id()
rect(rows, cols, top, left) Returns a rectangle of GridQubits.
square(diameter, top, left) Returns a square of GridQubits.
to_proto_dict([v2_proto]) Return the proto in dictionary form.