LorentzModel

Struct LorentzModel 

Source
pub struct LorentzModel<T> {
    pub c: T,
}
Expand description

Lorentz (hyperboloid) model manifold.

Points are represented as (n+1)-dimensional vectors where the first component is the “time” coordinate and the rest are “space” coordinates.

Fields§

§c: T

Curvature parameter (c > 0). The hyperboloid satisfies <x,x>_L = -1/c.

Implementations§

Source§

impl<T> LorentzModel<T>

Source

pub fn new(c: T) -> Self

Source

pub fn minkowski_dot(&self, x: &ArrayView1<'_, T>, y: &ArrayView1<'_, T>) -> T

Minkowski inner product: <x,y>_L = -x_0y_0 + x_1y_1 + … + x_n*y_n

Source

pub fn distance(&self, x: &ArrayView1<'_, T>, y: &ArrayView1<'_, T>) -> T

Lorentzian distance: d(x,y) = (1/sqrt(c)) * arcosh(-c * <x,y>_L)

Source

pub fn is_on_manifold(&self, x: &ArrayView1<'_, T>, tol: T) -> bool

Check if point is on the hyperboloid: <x,x>_L = -1/c

Source

pub fn project(&self, x: &ArrayView1<'_, T>) -> Array1<T>

Project point onto hyperboloid by scaling. Given x with x_0 > 0, find scale s such that <sx, sx>_L = -1/c.

Source

pub fn from_euclidean(&self, v: &ArrayView1<'_, T>) -> Array1<T>

Project from Euclidean space to hyperboloid. Maps an n-dimensional Euclidean vector to the (n+1)-dimensional hyperboloid.

Source

pub fn to_euclidean(&self, x: &ArrayView1<'_, T>) -> Array1<T>

Project from hyperboloid to Euclidean space (gnomonic projection). Maps an (n+1)-dimensional hyperboloid point to n-dimensional Euclidean.

Source

pub fn exp_map(&self, x: &ArrayView1<'_, T>, v: &ArrayView1<'_, T>) -> Array1<T>

Exponential map at point x: maps tangent vector v to manifold. exp_x(v) = cosh(||v||_L) * x + sinh(||v||_L) * v / ||v||_L where ||v||_L = sqrt(<v,v>_L) (Lorentzian norm of tangent vector).

Source

pub fn log_map(&self, x: &ArrayView1<'_, T>, y: &ArrayView1<'_, T>) -> Array1<T>

Logarithmic map at point x: maps manifold point y to tangent space at x. log_x(y) = d(x,y) * (y - <x,y>_L * c * x) / ||y - <x,y>_L * c * x||_L

Source

pub fn parallel_transport( &self, x: &ArrayView1<'_, T>, y: &ArrayView1<'_, T>, v: &ArrayView1<'_, T>, ) -> Array1<T>

Parallel transport of tangent vector v from point x to point y.

Source

pub fn origin(&self, dim: usize) -> Array1<T>

Origin of the hyperboloid: (1/sqrt(c), 0, 0, …, 0)

Auto Trait Implementations§

§

impl<T> Freeze for LorentzModel<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for LorentzModel<T>
where T: RefUnwindSafe,

§

impl<T> Send for LorentzModel<T>
where T: Send,

§

impl<T> Sync for LorentzModel<T>
where T: Sync,

§

impl<T> Unpin for LorentzModel<T>
where T: Unpin,

§

impl<T> UnwindSafe for LorentzModel<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.