View source on GitHub |
A cirq.Qid supporting Octagonal indexing.
cirq_rigetti.aspen_device.OctagonalQubit(
octagon_position: int
)
Args | |
---|---|
octagon_position
|
Position within octagon, indexed as pictured above. |
Raises | |
---|---|
ValueError
|
If the position specified is greater than 7. |
Methods
distance
distance(
other: cirq.Qid
) -> float
Returns the distance between two qubits.
Args | |
---|---|
other
|
An OctagonalQubit to which we are measuring distance. |
Returns | |
---|---|
The distance between two qubits. |
Raises | |
---|---|
TypeError
|
other qubit must be OctagonalQubit. |
validate_dimension
@staticmethod
validate_dimension( dimension: int ) -> None
Raises an exception if dimension
is not positive.
Raises | |
---|---|
ValueError
|
dimension is not positive.
|
with_dimension
with_dimension(
dimension: int
) -> 'Qid'
Returns a new qid with a different dimension.
Child classes can override. Wraps the qubit object by default.
Args | |
---|---|
dimension
|
The new dimension or number of levels. |
__eq__
__eq__(
other
)
Return self==value.
__ge__
__ge__(
other
)
Return self>=value.
__gt__
__gt__(
other
)
Return self>value.
__le__
__le__(
other
)
Return self<=value.
__lt__
__lt__(
other
)
Return self<value.
__ne__
__ne__(
other
)
Return self!=value.