pub struct CausalMultiField<T> { /* private fields */ }Expand description
Implementations§
Source§impl<T> CausalMultiField<T>
impl<T> CausalMultiField<T>
Source§impl<T> CausalMultiField<T>
impl<T> CausalMultiField<T>
Sourcepub fn normalize(&self) -> Self
pub fn normalize(&self) -> Self
Normalizes the field: result = self / ||self||.
Returns the field scaled to unit magnitude.
Sourcepub fn squared_magnitude(&self) -> T
pub fn squared_magnitude(&self) -> T
Computes the squared magnitude of the field.
Uses the L2 norm of the matrix representation.
Source§impl<T> CausalMultiField<T>
impl<T> CausalMultiField<T>
Source§impl<T> CausalMultiField<T>
impl<T> CausalMultiField<T>
Sourcepub fn commutator_lie(&self, rhs: &Self) -> Self
pub fn commutator_lie(&self, rhs: &Self) -> Self
Computes the Lie commutator: [A, B] = AB - BA.
The Lie bracket measures the non-commutativity of the geometric product.
Sourcepub fn commutator_geometric(&self, rhs: &Self) -> Self
pub fn commutator_geometric(&self, rhs: &Self) -> Self
Computes the geometric commutator: (AB - BA) / 2.
Equivalent to the Lie commutator scaled by 1/2.
Source§impl<T> CausalMultiField<T>
impl<T> CausalMultiField<T>
Sourcepub fn matrix_dim(&self) -> usize
pub fn matrix_dim(&self) -> usize
Returns the matrix dimension for the algebra.
For Cl(p,q,r), the matrix dimension is 2^⌈N/2⌉ where N = p + q + r.
Sourcepub fn data(&self) -> &CausalTensor<T>
pub fn data(&self) -> &CausalTensor<T>
Returns a reference to the underlying tensor.
Source§impl<T> CausalMultiField<T>
impl<T> CausalMultiField<T>
Sourcepub fn zeros(shape: [usize; 3], metric: Metric, dx: [T; 3]) -> Self
pub fn zeros(shape: [usize; 3], metric: Metric, dx: [T; 3]) -> Self
Creates a field filled with zero multivectors.
§Arguments
shape- Grid dimensions [Nx, Ny, Nz]metric- The metric signature of the algebradx- Grid spacing [dx, dy, dz]
Sourcepub fn ones(shape: [usize; 3], metric: Metric, dx: [T; 3]) -> Self
pub fn ones(shape: [usize; 3], metric: Metric, dx: [T; 3]) -> Self
Creates a field filled with identity matrices (scalar 1).
Each cell contains the identity element of the algebra.
Sourcepub fn from_coefficients(
mvs: &[CausalMultiVector<T>],
shape: [usize; 3],
dx: [T; 3],
) -> Selfwhere
T: Neg<Output = T>,
pub fn from_coefficients(
mvs: &[CausalMultiVector<T>],
shape: [usize; 3],
dx: [T; 3],
) -> Selfwhere
T: Neg<Output = T>,
Creates a field from a collection of CausalMultiVectors.
§Arguments
mvs- Flat array of multivectors in row-major ordershape- Grid dimensions [Nx, Ny, Nz]dx- Grid spacing [dx, dy, dz]
Sourcepub fn to_coefficients(&self) -> Vec<CausalMultiVector<T>>where
T: Neg<Output = T>,
pub fn to_coefficients(&self) -> Vec<CausalMultiVector<T>>where
T: Neg<Output = T>,
Downloads the field to a collection of CausalMultiVectors.
Converts from Matrix Representation back to coefficient form using trace projection.
Sourcepub fn compute_matrix_dim(n: usize) -> usize
pub fn compute_matrix_dim(n: usize) -> usize
Computes the matrix dimension for a given algebra dimension.
For Cl(p,q,r), the matrix dimension is 2^⌈N/2⌉ where N = p + q + r.
Source§impl<T> CausalMultiField<T>
impl<T> CausalMultiField<T>
Sourcepub fn curl(&self) -> Self
pub fn curl(&self) -> Self
Computes the curl: ∇ × F.
Returns the grade-2 component of the gradient ∇F.
Sourcepub fn divergence(&self) -> Self
pub fn divergence(&self) -> Self
Computes the divergence: ∇ · F.
Returns the scalar part (Grade 0) of the gradient ∇F.
Sourcepub fn gradient(&self) -> Self
pub fn gradient(&self) -> Self
Computes the gradient: ∇F.
Returns the full geometric derivative field (all grades).
Sourcepub fn partial_derivative(&self, axis: Axis) -> CausalTensor<T>where
T: Ring,
pub fn partial_derivative(&self, axis: Axis) -> CausalTensor<T>where
T: Ring,
Computes the partial derivative along a given axis.
Uses central difference: ∂F/∂x ≈ (F[x+1] - F[x-1]) / (2dx)
This implementation works on the flat data vector to avoid needing range-based slice operations.
Source§impl<T> CausalMultiField<T>
impl<T> CausalMultiField<T>
Sourcepub fn grade_project(&self, k: usize) -> Selfwhere
T: Neg<Output = T>,
pub fn grade_project(&self, k: usize) -> Selfwhere
T: Neg<Output = T>,
Projects the field onto grade k: ⟨F⟩_k.
§Arguments
k- The grade to project onto (0=scalar, 1=vector, 2=bivector, etc.)
Sourcepub fn scalar_part(&self) -> Selfwhere
T: Neg<Output = T>,
pub fn scalar_part(&self) -> Selfwhere
T: Neg<Output = T>,
Extracts the scalar part (grade 0): ⟨F⟩₀.
Sourcepub fn vector_part(&self) -> Selfwhere
T: Neg<Output = T>,
pub fn vector_part(&self) -> Selfwhere
T: Neg<Output = T>,
Extracts the vector part (grade 1): ⟨F⟩₁.
Sourcepub fn bivector_part(&self) -> Selfwhere
T: Neg<Output = T>,
pub fn bivector_part(&self) -> Selfwhere
T: Neg<Output = T>,
Extracts the bivector part (grade 2): ⟨F⟩₂.
Sourcepub fn trivector_part(&self) -> Selfwhere
T: Neg<Output = T>,
pub fn trivector_part(&self) -> Selfwhere
T: Neg<Output = T>,
Extracts the trivector part (grade 3): ⟨F⟩₃.
Sourcepub fn pseudoscalar_part(&self) -> Selfwhere
T: Neg<Output = T>,
pub fn pseudoscalar_part(&self) -> Selfwhere
T: Neg<Output = T>,
Extracts the pseudoscalar part (highest grade).
Source§impl<T> CausalMultiField<T>
impl<T> CausalMultiField<T>
Sourcepub fn inner_product(&self, rhs: &Self) -> Selfwhere
T: Neg<Output = T>,
pub fn inner_product(&self, rhs: &Self) -> Selfwhere
T: Neg<Output = T>,
Computes the inner product (grade-0 projection of geometric product).
Sourcepub fn outer_product(&self, rhs: &Self) -> Self
pub fn outer_product(&self, rhs: &Self) -> Self
Computes the outer product (wedge product).
Implemented via coefficient extraction and basis blade logic to ensure correctness for mixed-grade multivectors. (AB - BA)/2 is only valid for vectors.
Sourcepub fn cross(&self, rhs: &Self) -> Self
pub fn cross(&self, rhs: &Self) -> Self
Computes the cross product via Hodge dual of wedge.
A × B = -I(A ∧ B) where I is the pseudoscalar.
Sourcepub fn hodge_dual(&self) -> Self
pub fn hodge_dual(&self) -> Self
Applies the Hodge dual operation.
A* = A · I⁻¹ where I is the pseudoscalar.
Trait Implementations§
Source§impl<T> Add for &CausalMultiField<T>
impl<T> Add for &CausalMultiField<T>
Source§impl<T> Add for CausalMultiField<T>
impl<T> Add for CausalMultiField<T>
Source§impl<T: Clone> Clone for CausalMultiField<T>
impl<T: Clone> Clone for CausalMultiField<T>
Source§fn clone(&self) -> CausalMultiField<T>
fn clone(&self) -> CausalMultiField<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Debug> Debug for CausalMultiField<T>
impl<T: Debug> Debug for CausalMultiField<T>
Source§impl<T> Mul<&CausalMultiField<T>> for CausalMultiField<T>
impl<T> Mul<&CausalMultiField<T>> for CausalMultiField<T>
Source§type Output = CausalMultiField<T>
type Output = CausalMultiField<T>
* operator.