sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.31k stars 450 forks source link

bad gens for Free algebras over inexact rings #38383

Open fchapoton opened 1 month ago

fchapoton commented 1 month ago

Steps To Reproduce

No response

Expected Behavior

Avoid the numerical constant in front of the gens when possible

Actual Behavior

Here is the issue:

sage: A=FreeAlgebra(CC,['a','b'])
sage: A
Free Algebra on 2 generators (1.00000000000000*a, 1.00000000000000*b) over Complex Field with 53 bits of precision
sage: A.gens()
(1.00000000000000*a, 1.00000000000000*b)
sage: A.gen(0)
1.00000000000000*a

This make the following fail: GradedCommutativeAlgebra(CC,degrees=(Integer(1),Integer(1)), names=('a', 'b',))

Additional Information

Taken from https://stackoverflow.com/questions/77367021/

Environment

- **OS**:
- **Sage Version**:

Checklist

tscrim commented 1 month ago

I believe we could fix this by passing self.variable_names() along instead of self.gens().