edgarcosta / hilbertmodularforms

Mockup implementation of Hilbert Modular Forms
BSD 3-Clause "New" or "Revised" License
8 stars 15 forks source link

Organizing/hashing fields #461

Open jvoight opened 7 months ago

jvoight commented 7 months ago

Apparently we are inefficient in handling things like unit characters and coefficient rings across spaces. This leads to many duplicate copies of the same field. We either need to be smarter about creation, or find a simple way to hash.

From @abhijit-mudigonda:

Since the coefficient rings are computed space by space, a different field object is created for each HMFSpace. They may end up being the same (and they often are for simple cases). Right now, we keep track of which things are the same and the correct mappings between them using the strong coercion logic, but it'd be better if there were a parameter that causes Compositum(QuadraticField(5), CyclotomicField(6))" to be the same object every time rather than a different one.

(Elements given HMFSpace may also have coefficient ring different from the default coefficient ring of the HMFSpace. The DefaultCoefficientRing is the smallest possible coefficient ring for the space but e.g. if we compute an Eigenbasis, the coefficient field of each element will be whatever it is.)

Since there are a lot of coefficient fields floating around, a lot of which are defined in the exact same way (equal, not just isomorphic, per se) I just think it'd be nice if Magma knew that they were the same without any work on our part.