wuzp
Wrong Unit? Zero Points! Compile-time checks for units, coordinate systems and points vs. vectors.
Loading...
Searching...
No Matches
wuzp::LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ > Class Template Reference

A Lorentz transformation Lambda from the inertial frame From to the inertial frame To, which must be coordinate systems with the Minkowski metric (MinkowskiCoordinateSystem, see Minkowski and SpacetimeVector): the dimensionless passive linear transformation of spacetime vectors, with the time component first and in length units (x^0 = c t), that preserves the Minkowski metric eta = diag(1, -1, ..., -1): Lambda^T eta Lambda = eta (Carroll, Lecture Notes on General Relativity, https://arxiv.org/abs/gr-qc/9712019, eq. 1.14, whose signature (-, +, +, +) has the metric -eta, which gives the same condition), e.g. a boost (see createBoostMatrix()), a spatial rotation, or their compositions. More...

#include <wuzp/trafo/LorentzTransformation.hpp>

Inherits wuzp::PassiveTransformation< LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >, FromT_, ToT_ >.

Public Types

using LinearTransformationT
 The passive linear transformation with the matrix of the Lorentz transformation, whose transformations it shares.
using ValueT = ValueT_
using ValuesT = typename LinearTransformationT::ValuesT
using UnitsT = typename LinearTransformationT::UnitsT
using QuantitiesT = typename LinearTransformationT::QuantitiesT
Public Types inherited from wuzp::PassiveTransformation< LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >, FromT_, ToT_ >
using From
using To

Public Member Functions

 LorentzTransformation ()
 The identity: From and To are the same inertial frame.
template<typename... Args>
requires (sizeof...(Args) > 0 && !CopiesOrMoves<LorentzTransformation, Args...>)
 LorentzTransformation (Args &&... args)
 The Lorentz transformation whose matrix is constructed from the arguments, e.g. its elements row by row, or its quantities.
const QuantitiesT & getQuantities () const
 The matrix Lambda, which transforms the components v of a spacetime vector in From into its components Lambda v in To.
auto inverse () const
 The inverse Lorentz transformation, from To to From, whose matrix is eta Lambda^T eta = Lambda^-1: it needs no matrix inverse.
bool isValid (const ValueT tolerance=ValidityTolerance< ValueT >::value()) const
 Whether the matrix preserves the Minkowski metric eta: max_ij |(Lambda^T eta Lambda - eta)_ij| <= tolerance.
template<template< typename, int, int > typename ValuesOtherT_, typename ValueOtherT_, typename FromOtherT_, typename ToOtherT_, int DimensionOtherV_>
bool isApprox (const LorentzTransformation< ValuesOtherT_, ValueOtherT_, FromOtherT_, ToOtherT_, DimensionOtherV_ > &other, const ValueT precision=Precision< ValueT >::value()) const
 Whether both Lorentz transformations, which must transform between the same inertial frames, are approximately equal: their matrices are compared like the components of tensors (see Tensor::isApprox()).
Public Member Functions inherited from wuzp::PassiveTransformation< LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >, FromT_, ToT_ >
auto transform (ObjectT_ &&object) const
 The object in To.

Static Public Member Functions

template<typename... Args>
static LorentzTransformation makeUnchecked (Args &&... args)
 The Lorentz transformation whose matrix is constructed from the arguments, without checking it: the caller guarantees that it preserves the Minkowski metric, e.g. for a product of Lorentz transformations.

Detailed Description

template<template< typename, int, int > typename ValuesT_, typename ValueT_, MinkowskiCoordinateSystem FromT_, MinkowskiCoordinateSystem ToT_, int DimensionV_>
requires AnyValueMatrix<ValuesT_>
class wuzp::LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >

A Lorentz transformation Lambda from the inertial frame From to the inertial frame To, which must be coordinate systems with the Minkowski metric (MinkowskiCoordinateSystem, see Minkowski and SpacetimeVector): the dimensionless passive linear transformation of spacetime vectors, with the time component first and in length units (x^0 = c t), that preserves the Minkowski metric eta = diag(1, -1, ..., -1): Lambda^T eta Lambda = eta (Carroll, Lecture Notes on General Relativity, https://arxiv.org/abs/gr-qc/9712019, eq. 1.14, whose signature (-, +, +, +) has the metric -eta, which gives the same condition), e.g. a boost (see createBoostMatrix()), a spatial rotation, or their compositions.

It transforms the same tensors as the passive linear transformation with its matrix (see PassiveLinearTransformation). It composes with Lorentz transformations into Lorentz transformations, with linear transformations into linear transformations, and with Jacobians into Jacobians (see CompositionTraits). Its inverse is eta Lambda^T eta, which follows from eta = Lambda^T eta Lambda and needs no matrix inverse, and with which it transforms covectors and tensors with lower indices. In debug builds, i.e. if NDEBUG is not defined, the constructors check that the matrix preserves the metric (see isValid()), and throw std::invalid_argument if it does not, like those of the rotations (see ActiveSpatialRotation). Release builds do not check. makeUnchecked() skips the check, e.g. in hot paths.

Definition at line 54 of file LorentzTransformation.hpp.

Member Typedef Documentation

◆ LinearTransformationT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, MinkowskiCoordinateSystem FromT_, MinkowskiCoordinateSystem ToT_, int DimensionV_>
using wuzp::LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::LinearTransformationT
Initial value:
PassiveLinearTransformation<ValuesT_, ValueT_, FromT_, ToT_, DimensionV_,
A passive linear transformation, i.e. a change of basis, from the coordinate system From to the coord...
The units for values of the arithmetic type ValueT_, e.g. double, specialized for AccessImplementatio...
Definition traits.hpp:338

The passive linear transformation with the matrix of the Lorentz transformation, whose transformations it shares.

Definition at line 58 of file LorentzTransformation.hpp.

◆ QuantitiesT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, MinkowskiCoordinateSystem FromT_, MinkowskiCoordinateSystem ToT_, int DimensionV_>
using wuzp::LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::QuantitiesT = typename LinearTransformationT::QuantitiesT

Definition at line 63 of file LorentzTransformation.hpp.

◆ UnitsT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, MinkowskiCoordinateSystem FromT_, MinkowskiCoordinateSystem ToT_, int DimensionV_>
using wuzp::LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::UnitsT = typename LinearTransformationT::UnitsT

Definition at line 62 of file LorentzTransformation.hpp.

◆ ValuesT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, MinkowskiCoordinateSystem FromT_, MinkowskiCoordinateSystem ToT_, int DimensionV_>
using wuzp::LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::ValuesT = typename LinearTransformationT::ValuesT

Definition at line 61 of file LorentzTransformation.hpp.

◆ ValueT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, MinkowskiCoordinateSystem FromT_, MinkowskiCoordinateSystem ToT_, int DimensionV_>
using wuzp::LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::ValueT = ValueT_

Definition at line 60 of file LorentzTransformation.hpp.

Constructor & Destructor Documentation

◆ LorentzTransformation() [1/2]

template<template< typename, int, int > typename ValuesT_, typename ValueT_, MinkowskiCoordinateSystem FromT_, MinkowskiCoordinateSystem ToT_, int DimensionV_>
wuzp::LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::LorentzTransformation ( )
inline

The identity: From and To are the same inertial frame.

Definition at line 66 of file LorentzTransformation.hpp.

◆ LorentzTransformation() [2/2]

template<template< typename, int, int > typename ValuesT_, typename ValueT_, MinkowskiCoordinateSystem FromT_, MinkowskiCoordinateSystem ToT_, int DimensionV_>
template<typename... Args>
requires (sizeof...(Args) > 0 && !CopiesOrMoves<LorentzTransformation, Args...>)
wuzp::LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::LorentzTransformation ( Args &&... args)
inlineexplicit

The Lorentz transformation whose matrix is constructed from the arguments, e.g. its elements row by row, or its quantities.

Copies and moves are left to the implicit constructors, see CopiesOrMoves.

Exceptions
std::invalid_argumentIn debug builds, if the matrix does not preserve the Minkowski metric (see isValid()).

Definition at line 73 of file LorentzTransformation.hpp.

Member Function Documentation

◆ getQuantities()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, MinkowskiCoordinateSystem FromT_, MinkowskiCoordinateSystem ToT_, int DimensionV_>
const QuantitiesT & wuzp::LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::getQuantities ( ) const
inline

The matrix Lambda, which transforms the components v of a spacetime vector in From into its components Lambda v in To.

Definition at line 85 of file LorentzTransformation.hpp.

◆ inverse()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, MinkowskiCoordinateSystem FromT_, MinkowskiCoordinateSystem ToT_, int DimensionV_>
auto wuzp::LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::inverse ( ) const
inline

The inverse Lorentz transformation, from To to From, whose matrix is eta Lambda^T eta = Lambda^-1: it needs no matrix inverse.

Definition at line 88 of file LorentzTransformation.hpp.

◆ isApprox()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, MinkowskiCoordinateSystem FromT_, MinkowskiCoordinateSystem ToT_, int DimensionV_>
template<template< typename, int, int > typename ValuesOtherT_, typename ValueOtherT_, typename FromOtherT_, typename ToOtherT_, int DimensionOtherV_>
bool wuzp::LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::isApprox ( const LorentzTransformation< ValuesOtherT_, ValueOtherT_, FromOtherT_, ToOtherT_, DimensionOtherV_ > & other,
const ValueT precision = Precision<ValueT>::value() ) const
inline

Whether both Lorentz transformations, which must transform between the same inertial frames, are approximately equal: their matrices are compared like the components of tensors (see Tensor::isApprox()).

Definition at line 108 of file LorentzTransformation.hpp.

◆ isValid()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, MinkowskiCoordinateSystem FromT_, MinkowskiCoordinateSystem ToT_, int DimensionV_>
bool wuzp::LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::isValid ( const ValueT tolerance = ValidityTolerance<ValueT>::value()) const
inline

Whether the matrix preserves the Minkowski metric eta: max_ij |(Lambda^T eta Lambda - eta)_ij| <= tolerance.

The constructors check it in debug builds, with the tolerance ValidityTolerance. Like the definition of Lorentz transformations (Carroll, eq. 1.14), it also accepts the improper and the non-orthochronous ones, e.g. the reflection of time, whose determinant is -1.

Definition at line 98 of file LorentzTransformation.hpp.

◆ makeUnchecked()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, MinkowskiCoordinateSystem FromT_, MinkowskiCoordinateSystem ToT_, int DimensionV_>
template<typename... Args>
LorentzTransformation wuzp::LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::makeUnchecked ( Args &&... args)
inlinestatic

The Lorentz transformation whose matrix is constructed from the arguments, without checking it: the caller guarantees that it preserves the Minkowski metric, e.g. for a product of Lorentz transformations.

Definition at line 80 of file LorentzTransformation.hpp.


The documentation for this class was generated from the following file: