lloca.utils.lorentz
Basic operations in Minkowski space.
Functions
|
Compute the cross product in Minkowski space using the Laplace expansion. |
|
Create a identity matrix of given shape |
|
Lorentz inner product, i.e v1^T @ g @ v2 |
|
Create a metric tensor of given shape |
Lorentz norm, i.e. v^T @ g @ v. |
- lloca.utils.lorentz.lorentz_cross(v1, v2, v3)[source]
Compute the cross product in Minkowski space using the Laplace expansion. Note that this cross product takes three inputs vectors.
- Parameters:
v1 (torch.Tensor) – Tensors of shape (…, 4) representing vectors in Minkowski space.
v2 (torch.Tensor) – Tensors of shape (…, 4) representing vectors in Minkowski space.
v3 (torch.Tensor) – Tensors of shape (…, 4) representing vectors in Minkowski space.
- Returns:
The cross product of the three vectors, shape (…, 4).
- Return type:
torch.Tensor
- lloca.utils.lorentz.lorentz_eye(dims, device=None, dtype=torch.float32)[source]
Create a identity matrix of given shape
- Parameters:
dims (tuple) – Dimension of the output tensor, e.g. (2, 3) for a 2x3 matrix
device (torch.device) – Device to create the tensor on, by default torch.device(“cpu”)
dtype (torch.dtype) – Data type of the tensor, by default torch.float32
- Returns:
Identity matrix of shape (…, 4, 4)
- Return type:
torch.Tensor
- lloca.utils.lorentz.lorentz_inner(v1, v2)[source]
Lorentz inner product, i.e v1^T @ g @ v2
- Parameters:
v1 (torch.Tensor) – Tensors of shape (…, 4)
v2 (torch.Tensor) – Tensors of shape (…, 4)
- Returns:
Lorentz inner product of shape (…, )
- Return type:
torch.Tensor
- lloca.utils.lorentz.lorentz_metric(dims, device=None, dtype=torch.float32)[source]
Create a metric tensor of given shape
- Parameters:
dims (tuple) – Dimension of the output tensor, e.g. (2, 3) for a 2x3 matrix
device (torch.device) – Device to create the tensor on, by default torch.device(“cpu”)
dtype (torch.dtype) – Data type of the tensor, by default torch.float32
- Returns:
Metric tensor of shape (…, 4, 4)
- Return type:
torch.Tensor