Expand description
§deep_causality_metric
Metric signature types and sign conventions for Clifford algebras and physics.
This crate provides a foundational set of types for working with metric signatures in Clifford algebras Cl(p, q, r), Riemannian geometry, and physics.
§Key Features
- Single Source of Truth: Consolidates all metric signature logic
- Zero Dependencies: Serves as a foundational leaf crate
- Type-Safe Conventions: Compile-time enforcement of physics sign conventions
- Cross-Crate Integration: Enables consistent metric handling
§Core Types
Metric: The core enum representing Clifford algebra signaturesMetricError: Error type for metric operationsLorentzianMetric: Trait for convention-specific wrappersEastCoastMetric: Wrapper for (-+++) convention (GR)WestCoastMetric: Wrapper for (+—) convention (Particle Physics)
§Sign Conventions
| Convention | Signature | g_{μν} | Used By |
|---|---|---|---|
| East Coast | (-+++) | diag(-1,1,1,1) | MTW, GR textbooks |
| West Coast | (+—) | diag(1,-1,-1,-1) | Weinberg, Particle physics |
§Example
use deep_causality_metric::{
Metric, EastCoastMetric, WestCoastMetric, LorentzianMetric,
};
// Create a standard 4D Minkowski metric in West Coast convention
let west = Metric::Minkowski(4);
assert_eq!(west.sign_of_sq(0), 1); // time is +1
assert_eq!(west.sign_of_sq(1), -1); // space is -1
// Use type-safe wrappers for convention enforcement
let east = EastCoastMetric::minkowski_4d();
assert_eq!(east.time_sign(), -1);
assert_eq!(east.space_sign(), 1);
let west = WestCoastMetric::minkowski_4d();
assert_eq!(west.time_sign(), 1);
assert_eq!(west.space_sign(), -1);Structs§
- East
Coast Metric - A Lorentzian metric in East Coast (-+++) convention.
- West
Coast Metric - A Lorentzian metric in West Coast (+—) convention.
Enums§
- Metric
- Defines the metric signature of the Clifford Algebra Cl(p, q, r).
- Metric
Error - Errors that can occur during metric operations.
Constants§
- MINKOWSKI_
4D - Default 4D Minkowski spacetime (East Coast convention).
- PARTICLE_
MINKOWSKI_ 4D - Standard 4D Minkowski spacetime for Particle Physics.
- RELATIVITY_
MINKOWSKI_ 4D - Standard 4D Minkowski spacetime for General Relativity.
Traits§
- Lorentzian
Metric - Trait for convention-specific Lorentzian metric wrappers.
Functions§
- detect_
convention - Attempt to detect the sign convention of a Lorentzian metric.
- east_
to_ west - Convert an East Coast (-+++) metric to West Coast (+—).
- is_
lorentzian - Check if a metric is a valid Lorentzian metric (has one time dimension).
- west_
to_ east - Convert a West Coast (+—) metric to East Coast (-+++).
Type Aliases§
- Particle
Metric - For Particle Physics modules: West Coast (+—)
- Physics
Metric - Default physics metric (configurable): East Coast.
- Relativity
Metric - For General Relativity modules: East Coast (-+++)