Skip to main content

Rotation

Trait Rotation 

Source
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§

Source

fn rotate_x(&self, angle: T) -> Self

Rotation around the X-axis. Quaternions: Axis i. Quantum: Pauli X.

Source

fn rotate_y(&self, angle: T) -> Self

Rotation around the Y-axis. Quaternions: Axis j. Quantum: Pauli Y.

Source

fn rotate_z(&self, angle: T) -> Self

Rotation around the Z-axis (Phase). Quaternions: Axis k. Quantum: Pauli Z.

Source

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.

Implementors§