feat(mv): add components() method for extracting multivector coordinates#547
feat(mv): add components() method for extracting multivector coordinates#547utiberious wants to merge 1 commit intopygae:masterfrom
Conversation
Adds Mv.components() which returns a dictionary mapping each basis blade to its scalar coefficient. This provides a convenient way to extract individual coordinates for further processing, e.g. v.components()[e_1] returns the e_1 coefficient. Fixes #4
|
Thanks for this. CI fails on two flake8 errors worth fixing first:
Also the mixed-grade test only checks Kingdon cross-check: |
|
Also worth re-reading #483: the ask was extracting coords as a list for numeric use ( |
|
Closing the PR. Please open a new PR for adding the example. Should keep the original |
Summary
Adds
Mv.components()that returns a dict mapping basis blades to their scalar coefficients, making it easy to extract coordinates from a multivector.Fixes #483
Changes
galgebra/mv.py: Addcomponents()method that iterates over blade expansion and returns{blade_symbol: coefficient}dicttest/test_mv.py: Add tests for scalar, vector, and general multivector decompositionExample
Test plan