cirq.LineQid

class cirq.LineQid(x: int, dimension: int)[source]

A qid on a 1d lattice with nearest-neighbor connectivity.

LineQids have a single attribute, and integer coordinate ‘x’, which
identifies the qids location on the line. LineQids are ordered by
this integer.

One can construct new LineQids by adding or subtracting integers:

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

>>> cirq.LineQid(2, dimension=3) - 1
cirq.LineQid(1, dimension=3)
__init__(x: int, dimension: int) → None[source]

Initializes a line qid at the given x coordinate.

Parameters
  • x – The x coordinate.

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