pub trait Rotation<T: RealField> {
// Required methods
fn rotate_x(&self, angle: T) -> Self;
fn rotate_y(&self, angle: T) -> Self;
fn rotate_z(&self, angle: T) -> Self;
fn global_phase(&self, angle: T) -> Self;
}Expand description
A trait for types that can be rotated in 3D space (or the Bloch Sphere).
- T: The scalar type (angle).
Required Methods§
Sourcefn rotate_x(&self, angle: T) -> Self
fn rotate_x(&self, angle: T) -> Self
Rotation around the X-axis.
Quaternions: Axis i. Quantum: Pauli X.
Sourcefn rotate_y(&self, angle: T) -> Self
fn rotate_y(&self, angle: T) -> Self
Rotation around the Y-axis.
Quaternions: Axis j. Quantum: Pauli Y.
Sourcefn rotate_z(&self, angle: T) -> Self
fn rotate_z(&self, angle: T) -> Self
Rotation around the Z-axis (Phase).
Quaternions: Axis k. Quantum: Pauli Z.
Sourcefn global_phase(&self, angle: T) -> Self
fn global_phase(&self, angle: T) -> Self
Global Phase Shift. $P(\phi) = e^{i\phi}$.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.