cirq.GridQid

class cirq.GridQid(row: int, col: int, *, dimension: int)[source]

A qid on a 2d square lattice

GridQid uses row-major ordering:

GridQid(0, 0, dimension=2) < GridQid(0, 1, dimension=2)
< GridQid(1, 0, dimension=2) < GridQid(1, 1, dimension=2)

New GridQid can be constructed by adding or subtracting tuples

>>> cirq.GridQid(2, 3, dimension=2) + (3, 1)
cirq.GridQid(5, 4, dimension=2)

>>> cirq.GridQid(2, 3, dimension=2) - (1, 2)
cirq.GridQid(1, 1, dimension=2)
__init__(row: int, col: int, *, dimension: int) → None[source]

Initializes a grid qid at the given row, col coordinate

Parameters
  • row – the row coordinate

  • col – the column coordinate

  • dimension – The dimension of the qid, e.g. the number of quantum levels.