Shortcuts

qiskit.quantum_info.Quaternion

class Quaternion(data)[Quellcode]

A class representing a Quaternion.

__init__(data)[Quellcode]

Initialize self. See help(type(self)) for accurate signature.

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.

to_matrix()

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)[Quellcode]

Return quaternion for rotation about given axis.

Parameter
  • angle (float) – Angle in radians.

  • axis (str) – Axis for rotation

Rückgabe

Quaternion for axis rotation.

Rückgabetyp

Quaternion

Verursacht

ValueError – Invalid input axis.

classmethod from_euler(angles, order='yzy')[Quellcode]

Generate a quaternion from a set of Euler angles.

Parameter
  • angles (array_like) – Array of Euler angles.

  • order (str) – Order of Euler rotations. ‚yzy‘ is default.

Rückgabe

Quaternion representation of Euler rotation.

Rückgabetyp

Quaternion

norm()[Quellcode]

Norm of quaternion.

normalize(inplace=False)[Quellcode]

Normalizes a Quaternion to unit length so that it represents a valid rotation.

Parameter

inplace (bool) – Do an inplace normalization.

Rückgabe

Normalized quaternion.

Rückgabetyp

Quaternion

to_matrix()[Quellcode]

Converts a unit-length quaternion to a rotation matrix.

Rückgabe

Rotation matrix.

Rückgabetyp

ndarray

to_zyz()[Quellcode]

Converts a unit-length quaternion to a sequence of ZYZ Euler angles.

Rückgabe

Array of Euler angles.

Rückgabetyp

ndarray

Zu sehen ist lang: German
Sprachen
English
Japanese
German
Korean