Optimizing _from_dict in CombinatorialFreeModule

26 views
Skip to first unread message

Manpreet Singh

unread,
Mar 15, 2026, 3:00:16 PM (4 days ago) Mar 15
to sage-devel
Hi,

I am a 2nd year undergraduate student from Thapar Institute
of Engineering and Technology, India, interested in the
"Improve free module implementations" project for GSoC 2026.

I have been contributing to CombinatorialFreeModule:

- #41787 - Improve dimension() docstring
- #41799 - Add example to term() docstring
- #41800 - Add examples to monomial() docstring
- #41801 - Add input validation to term()
- #41802 - Replace assert with TypeError in _from_dict()
- #41817 - Optimize _from_dict to single pass when coerce=True
           and remove_zeros=True

Regarding PR #41817, I optimized _from_dict to use a single
pass when both coerce=True and remove_zeros=True are set,
avoiding an intermediate dictionary allocation. I wanted
to ask whether this approach is correct or was the two-pass
implementation intentional for a specific reason?

Thanks,
[Manpreet Singh]
Reply all
Reply to author
Forward
0 new messages