Qubit Rotations (quanguru.QuantumToolbox.spinRotations
)#
Contains functions to create qubit rotation operators.
Functions#
|
Creates the operator |
|
Creates the operator |
|
Creates the operator |
|
Creates the operator |
|
Creates the operator |
Function Name |
Docstrings |
Examples |
Unit Tests |
Tutorials |
---|---|---|---|---|
qubRotation |
✅ |
❌ |
❌ |
❌ |
spinRotation |
✅ |
❌ |
❌ |
❌ |
xRotation |
✅ |
❌ |
❌ |
❌ |
yRotation |
✅ |
❌ |
❌ |
❌ |
zRotation |
✅ |
❌ |
❌ |
❌ |
- xRotation(angle: float, sparse: bool = True) Union[scipy.sparse._base.spmatrix, numpy.ndarray] [source]#
Creates the operator
for qubit rotation around the x-axis by angle
.
- Parameters
angle (float) – angle of rotation around x
sparse (bool) – if True(False), the returned Matrix type will be sparse(array)
- Returns
Qubit X rotation operator
- Return type
Matrix
Examples
# TODO
- yRotation(angle: float, sparse: bool = True) Union[scipy.sparse._base.spmatrix, numpy.ndarray] [source]#
Creates the operator
for qubit rotation around the y-axis by angle
.
- Parameters
angle (float) – angle of rotation around y
sparse (bool) – if True(False), the returned Matrix type will be sparse(array)
- Returns
Qubit Y rotation operator
- Return type
Matrix
Examples
# TODO
- zRotation(angle: float, sparse: bool = True) Union[scipy.sparse._base.spmatrix, numpy.ndarray] [source]#
Creates the operator
for qubit rotation around the z-axis by angle
.
- Parameters
angle (float) – angle of rotation around z
sparse (bool) – if True(False), the returned Matrix type will be sparse(array)
- Returns
Qubit Z rotation operator
- Return type
Matrix
Examples
# TODO
- qubRotation(xyz: str, angle: float, sparse: bool = True) Union[scipy.sparse._base.spmatrix, numpy.ndarray] [source]#
Creates the operator
for qubit rotation around the i = x/y/z-axis by angle
.
- Parameters
xyz (str) – string for rotation direction x, y, or z
angle (float) – angle of rotation
sparse (bool) – if True(False), the returned Matrix type will be sparse(array)
- Returns
Qubit x/y/z rotation operator.
- Return type
Matrix
Examples
# TODO
- spinRotation(xyz: str, angle: float, j: float, sparse: bool = True, isDim: bool = False) Union[scipy.sparse._base.spmatrix, numpy.ndarray] [source]#
Creates the operator
for a spin value j rotation around i = x/y/z-axis by angle
.
- Parameters
xyz (str) – string for rotation direction x, y, or z
angle (float) – angle of rotation
j (int or float) – integer or half-integer spin quantum number, or the dimension (then spin quantum number = (d-1)/2)
sparse (bool) – if True(False), the returned Matrix type will be sparse(array)
isDim (bool) – boolean for whether j is spin quantum number of dimension
- Returns
Spin x/y/z rotation operator.
- Return type
Matrix
Examples
# TODO