Skip to content

Conversation

Hapsa21
Copy link

@Hapsa21 Hapsa21 commented Aug 31, 2025

Fixes #40738

Problem:

When multiplying elements of an ExteriorAlgebra over the Symbolic Ring (SR), symbolic coefficients were being dropped in certain cases, such as in the product (x*a)*(y*b).

Solution:

This PR corrects the multiplication logic in ExteriorAlgebraElement._mul_ by:

  1. Defining R = self.base_ring() at the start of the method.
  2. Explicitly coercing the coefficients to the base ring (R(cl) * R(cr)) before they are multiplied.

This ensures that symbolic multiplication is handled correctly, preserving all coefficients as expected.


### Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created a new test for this change.
  • I have updated the documentation and checked the documentation preview.

### Hourglass

  • List all open PRs that this PR logically depends on.

@fchapoton
Copy link
Contributor

this looks too complicated, as coercion should happen automatically

you need to add a doctest showing success where there was failure

@Hapsa21 Hapsa21 force-pushed the fix-exterior-algebra-bug branch from befcb5c to 647d329 Compare September 3, 2025 13:09
@Hapsa21
Copy link
Author

Hapsa21 commented Sep 3, 2025

I've added the doctest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ExteriorAlgebra over symbolic ring drops variable coefficients
2 participants