View source on GitHub |
A qubit in 2d.
Inherits From: ThreeDQubit
cirq_pasqal.pasqal_qubits.TwoDQubit(
x: float, y: float
)
Attributes | |
---|---|
dimension
|
Returns the dimension or the number of quantum levels this qid has. E.g. 2 for a qubit, 3 for a qutrit, etc. |
Methods
cube
@staticmethod
cube( diameter: int, x0: float = 0, y0: float = 0, z0: float = 0 ) -> List['ThreeDQubit']
Returns a cube of ThreeDQubits.
Args | |
---|---|
diameter
|
Length of a side of the square. |
x0
|
x-coordinate of the first qubit. |
y0
|
y-coordinate of the first qubit |
z0
|
z-coordinate of the first qubit. |
Returns | |
---|---|
A list of ThreeDQubits filling in a square grid |
distance
distance(
other: cirq.ops.Qid
) -> float
Returns the distance between two qubits in 3d.
parallelep
@staticmethod
parallelep( rows: int, cols: int, lays: int, x0: float = 0, y0: float = 0, z0: float = 0 ) -> List['ThreeDQubit']
Returns a parallelepiped of ThreeDQubits.
Args | |
---|---|
rows
|
Number of rows in the parallelepiped. |
cols
|
Number of columns in the parallelepiped. |
lays
|
Number of layers in the parallelepiped. |
x0
|
x-coordinate of the first qubit. |
y0
|
y-coordinate of the first qubit. |
z0
|
z-coordinate of the first qubit. |
Returns | |
---|---|
A list of ThreeDQubits filling in a 3d grid |
rect
@staticmethod
rect( rows: int, cols: int, x0: float = 0, y0: float = 0 ) -> List['TwoDQubit']
Returns a rectangle of TwoDQubit.
Args | |
---|---|
rows
|
Number of rows in the rectangle. |
cols
|
Number of columns in the rectangle. |
x0
|
x-coordinate of the first qubit. |
y0
|
y-coordinate of the first qubit. |
Returns | |
---|---|
A list of TwoDQubits filling in a rectangular grid |
square
@staticmethod
square( diameter: int, x0: float = 0, y0: float = 0 ) -> List['TwoDQubit']
Returns a square of TwoDQubit.
Args | |
---|---|
diameter
|
Length of a side of the square. |
x0
|
x-coordinate of the first qubit. |
y0
|
y-coordinate of the first qubit. |
Returns | |
---|---|
A list of TwoDQubits filling in a square grid |
triangular_lattice
@staticmethod
triangular_lattice( l: int, x0: float = 0, y0: float = 0 )
Returns a triangular lattice of TwoDQubits.
Args | |
---|---|
l
|
Number of qubits along one direction. |
x0
|
x-coordinate of the first qubit. |
y0
|
y-coordinate of the first qubit. |
Returns | |
---|---|
A list of TwoDQubits filling in a triangular lattice. |
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.