lgatr.primitives.linear
Linear operations on multivectors, in particular linear basis maps.
Functions
|
Pin-equivariant linear map |
Computes the grade involution of a multivector. |
|
Projects an input tensor to the individual grades. |
|
|
Computes the reversal of a multivector. |
- lgatr.primitives.linear.equi_linear(x, coeffs)[source]
Pin-equivariant linear map
f(x) = sum_{a,j} coeffs_a W^a_ij x_j
.The W^a are seven pre-defined basis elements.
- Parameters:
x (torch.Tensor) – Input multivector with shape (…, in_channels, 16). Batch dimensions must be broadcastable between x and coeffs.
coeffs (torch.Tensor) – Coefficients for the basis elements with shape (out_channels, in_channels, 10). Batch dimensions must be broadcastable between x and coeffs.
- Returns:
outputs – Result with shape (…, 16). Batch dimensions are result of broadcasting between x and coeffs.
- Return type:
torch.Tensor
- lgatr.primitives.linear.grade_involute(x)[source]
Computes the grade involution of a multivector.
The reversal has the same scalar, bivector, and pseudoscalar components, but flips sign in the vector and trivector components.
- Parameters:
x (torch.Tensor) – Input multivector with shape (…, 16).
- Returns:
outputs – Output multivector with shape (…, 16).
- Return type:
torch.Tensor
- lgatr.primitives.linear.grade_project(x)[source]
Projects an input tensor to the individual grades.
The return value is a single tensor with a new grade dimension.
- Parameters:
x (torch.Tensor) – Input multivector with shape (…, 16).
- Returns:
outputs – Output multivector with shape (…, 5, 16). The second-to-last dimension indexes the grades.
- Return type:
torch.Tensor
- lgatr.primitives.linear.reverse(x)[source]
Computes the reversal of a multivector.
The reversal has the same scalar, vector, and pseudoscalar components, but flips sign in the bivector and trivector components.
- Parameters:
x (torch.Tensor) – Input multivector with shape (…, 16).
- Returns:
outputs – Output multivector with shape (…, 16).
- Return type:
torch.Tensor