qiskit.quantum_info.Quaternion¶
-
class
Quaternion
(data)[ソース]¶ A class representing a Quaternion.
Methods
__init__
(data)Initialize self.
from_axis_rotation
(angle, axis)Return quaternion for rotation about given axis.
from_euler
(angles[, order])Generate a quaternion from a set of Euler angles.
norm
()Norm of quaternion.
normalize
([inplace])Normalizes a Quaternion to unit length so that it represents a valid rotation.
Converts a unit-length quaternion to a rotation matrix.
to_zyz
()Converts a unit-length quaternion to a sequence of ZYZ Euler angles.
-
classmethod
from_axis_rotation
(angle, axis)[ソース]¶ Return quaternion for rotation about given axis.
- パラメータ
angle (float) – Angle in radians.
axis (str) – Axis for rotation
- 戻り値
Quaternion for axis rotation.
- 戻り値の型
- 例外
ValueError – Invalid input axis.
-
classmethod
from_euler
(angles, order='yzy')[ソース]¶ Generate a quaternion from a set of Euler angles.
- パラメータ
angles (array_like) – Array of Euler angles.
order (str) – Order of Euler rotations. 『yzy』 is default.
- 戻り値
Quaternion representation of Euler rotation.
- 戻り値の型
-
normalize
(inplace=False)[ソース]¶ Normalizes a Quaternion to unit length so that it represents a valid rotation.
- パラメータ
inplace (bool) – Do an inplace normalization.
- 戻り値
Normalized quaternion.
- 戻り値の型
-
classmethod