|
wuzp
Wrong Unit? Zero Points! Compile-time checks for units, coordinate systems and points vs. vectors.
|
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>
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. | |
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.
| using wuzp::LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::LinearTransformationT |
The passive linear transformation with the matrix of the Lorentz transformation, whose transformations it shares.
Definition at line 58 of file LorentzTransformation.hpp.
| using wuzp::LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::QuantitiesT = typename LinearTransformationT::QuantitiesT |
Definition at line 63 of file LorentzTransformation.hpp.
| using wuzp::LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::UnitsT = typename LinearTransformationT::UnitsT |
Definition at line 62 of file LorentzTransformation.hpp.
| using wuzp::LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::ValuesT = typename LinearTransformationT::ValuesT |
Definition at line 61 of file LorentzTransformation.hpp.
| using wuzp::LorentzTransformation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::ValueT = ValueT_ |
Definition at line 60 of file LorentzTransformation.hpp.
|
inline |
The identity: From and To are the same inertial frame.
Definition at line 66 of file LorentzTransformation.hpp.
|
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.
| std::invalid_argument | In debug builds, if the matrix does not preserve the Minkowski metric (see isValid()). |
Definition at line 73 of file LorentzTransformation.hpp.
|
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.
|
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.
|
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.
|
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.
|
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.