cirq.LineQubit¶

class cirq.LineQubit(x: int)[source]

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

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

One can construct new LineQubits by adding or subtracting integers:

>>> cirq.LineQubit(1) + 3
cirq.LineQubit(4)

>>> cirq.LineQubit(2) - 1
cirq.LineQubit(1)

__init__(x: int) → None

Initializes a line qubit at the given x coordinate.

Methods

 is_adjacent(other) Determines if two qubits are adjacent line qubits. neighbors([qids]) Returns qubits that are potential neighbors to this LineQubit range(*range_args) Returns a range of line qubits. validate_dimension(dimension) Raises an exception if dimension is not positive. with_dimension(dimension) Returns a new qid with a different dimension.

Attributes

 dimension Returns the dimension or the number of quantum levels this qid has. x