Advanced Usage¶
Advanced techniques for using mp-units in sophisticated scenarios beyond standard quantity calculations.
Available Guides¶
- Pure Dimensional Analysis - Use dimensions without specific units for symbolic computation, compile-time validation, and custom arithmetic types
- Type-Safe Indices and Offsets - Model container indices and offsets as quantities with point origins, covering 0-based vs 1-based indexing, SI vs IEC element prefixes, and stride arithmetic
- Decompose a Vector Quantity into Components - Split a vector quantity into named, strongly-typed 1D-vector component quantities, covering the quantity hierarchy,
get<Idx>/get<QS>, structured bindings, and the representation requirements - Represent an Axial Vector as an Antisymmetric Tensor - Model a quantity the ISQ defines as a vector (e.g. angular velocity) as a skew-symmetric tensor in your own domain, bridged to
isq::angular_velocitywith an explicithat/veedual - Ensure Ultimate Safety - Combine
constrainedreps,constraint_violation_handler, andcheck_in_rangefor guaranteed bounds enforcement - Working With Nondimensionalized Physics - Use mp-units alongside natural units and dimensionless quantities, covering the complete scale-in/scale-out workflow and tradeoffs
When to Use These Guides¶
Use these advanced techniques when you:
- Need dimensional analysis without actual quantity values
- Build symbolic computation or automatic differentiation systems
- Validate dimensional consistency at compile-time
- Work with template metaprogramming involving dimensions
- Implement custom arithmetic types with dimensional correctness
- Work in nondimensionalized or natural-unit systems and want to retain strong typing