LineQid(x: int, dimension: int)¶
A qid on a 1d lattice with nearest-neighbor connectivity.
LineQids have a single attribute, and integer coordinate ‘x’, whichidentifies the qids location on the line.
LineQids are ordered bythis 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¶
Initializes a line qid at the given x coordinate.
x – The x coordinate.
dimension – The dimension of the qid, e.g. the number of quantum levels.
for_gate(val[, start, step])
Returns a range of line qids with the same qid shape as the gate.
for_qid_shape(qid_shape[, start, step])Returns a range of line qids for each entry in
Determines if two qubits are adjacent line qubits.
Returns qubits that are potential neighbors to this LineQubit
Returns a range of line qids.
Raises an exception if
dimensionis not positive.
Returns a new qid with a different dimension.
AttributesReturns the dimension or the number of quantum levels this qid has.