cirq_rigetti.aspen_device.OctagonalQubit

A cirq.Qid supporting Octagonal indexing.

octagon_position Position within octagon, indexed as pictured above.

ValueError If the position specified is greater than 7.

dimension Returns the dimension or the number of quantum levels this qid has. E.g. 2 for a qubit, 3 for a qutrit, etc.
octagon_position

x Returns the horizontal position of the qubit, assuming each side of the octagon has length 1.
y Returns the vertical position of the qubit, assuming each side of the octagon has length 1. The y-axis is oriented downwards.
z Because this is a 2-dimensional qubit, this will always be 0.

Methods

distance

View source

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

Raises an exception if dimension is not positive.

Raises
ValueError dimension is not positive.

with_dimension

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__

Return self==value.

__ge__

Return self>=value.

__gt__

Return self>value.

__le__

Return self<=value.

__lt__

Return self<value.

__ne__

Return self!=value.