pub trait MetricTensor4D {
// Required methods
fn metric_tensor(&self) -> [[f64; 4]; 4];
fn update_metric_tensor(&mut self, new_metric: [[f64; 4]; 4]);
}Expand description
Trait for exposing and modifying a local 4×4 spacetime metric tensor.
This trait defines both read and write access to a spacetime metric gᵤᵥ,
typically used for computing intervals and geodesics. By including a mutation method,
the curvature at a point can be dynamically updated in response to external fields,
symbolic programs, or causal evolution.
§Convention
- Tensor is 4×4, with ordering
[t, x, y, z] - Signature is (− + + +)
- Symmetry (
gᵤᵥ = gᵥᵤ) must be preserved by caller
Required Methods§
Sourcefn metric_tensor(&self) -> [[f64; 4]; 4]
fn metric_tensor(&self) -> [[f64; 4]; 4]
Returns the current local metric tensor gᵤᵥ.