![]() |
THIS CLASS IS DEPRECATED.
Inherits From: OctagonalQubit
cirq_rigetti.aspen_device.AspenQubit(
octagon: int, octagon_position: int
)
IT WILL BE REMOVED IN cirq v1.6
.
Cirq-Rigetti is deprecated. For more details or to provide feedback see https://github.com/quantumlib/Cirq/issues/7058
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 AspenQubit to which we are measuring distance. |
Returns | |
---|---|
The distance between two qubits. |
Raises | |
---|---|
TypeError
|
other qubit must be AspenQubit. |
from_aspen_index
@staticmethod
from_aspen_index( index: int ) -> 'AspenQubit'
Initializes an AspenQubit
at the given index.
See OctagonalQubit
to understand
OctagonalQubit indexing.
Args | |
---|---|
index
|
The index at which to initialize the AspenQubit .
|
Returns | |
---|---|
The AspenQubit with requested index. |
Raises | |
---|---|
ValueError
|
index is not a valid octagon position. |
from_grid_qubit
@staticmethod
from_grid_qubit( grid_qubit: cirq.GridQubit ) -> 'AspenQubit'
Converts cirq.GridQubit
to AspenQubit
.
Returns | |
---|---|
The equivalent AspenQubit. |
Raises | |
---|---|
ValueError
|
GridQubit cannot be converted to AspenQubit. |
from_named_qubit
@staticmethod
from_named_qubit( qubit: cirq.NamedQubit ) -> 'AspenQubit'
Converts cirq.NamedQubit
to AspenQubit
.
Returns | |
---|---|
The equivalent AspenQubit. |
Raises | |
---|---|
ValueError
|
NamedQubit cannot be converted to AspenQubit. |
UnsupportedQubit
|
If the supplied qubit is not a named qubit with an octagonal index. |
to_grid_qubit
to_grid_qubit() -> cirq.GridQubit
Converts AspenQubit
to cirq.GridQubit
.
Returns | |
---|---|
The equivalent GridQubit. |
Raises | |
---|---|
ValueError
|
AspenQubit cannot be converted to GridQubit. |
to_named_qubit
to_named_qubit() -> cirq.NamedQubit
Converts AspenQubit
to cirq.NamedQubit
.
Returns | |
---|---|
The equivalent NamedQubit. |
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.