New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dirichlet character bug #5792
Comments
comment:1
Well, I've tracked down the problem, but I'm not sure what the "right" fix is. (There are several possibilities.) Amusingly, it's not actually the trivial character that causes trouble directly -- it's the other character here. (The exception gets raised trying to raise
Then the nontrivial character of conductor 4 gets coerced in, which actually works -- but that's the character that causes trouble:
In some sense, this is silly: it should at least have Of course, now that just makes the call to
I think the first is probably the more pragmatic choice, though maybe less "philosophically correct"? I've attached a patch that does the former. |
Attachment: trac-5792.patch.gz |
comment:2
There is a bit more too this, though. Basically, the whole Dirichlet character machinery goes a bit mad whenever you have two Dirichlet characters with the same modulus and base ring, but where the zeta orders aren't the same. For a start, the parent DirichletGroups compare as equal but their elements are different -- or at least they will be if we fix the !call! method properly. Similarly, arithmetic coercion is screwed up, in some interesting ways:
Here the coercion model will fail miserably to find the right parent. One option would be to prevent Dirichlet groups ever being created for which the zeta order is not maximal for the given base ring. This would sort of work, but would restrict us to Dirichlet groups over integral domains (so we can guarantee that the group of roots of unity in the ring is cyclic) and it would make it a pain to implement base extension (at present the base_extend method for DirichletGroup_class just base extends the zeta element it already knows about. The alternative is to be "honest" and make Dirichlet groups with the same modulus and base ring but different zeta order into genuinely different objects, comparing as unequal and with different string representations. One can then sort out coercion arithmetic using the machinery from sage.categories.pushout; I coded this up as an experiment (creating a class "DirichletGroupExtensionFunctor" whose effect was to extend Dirichlet groups by adding an nth root of unity into their value group). But it's a bit of a cheat since my "functors" aren't actually functors in any natural category I can think of. |
comment:4
I agree -- the business of So my vote: we commit this patch, and then open a new ticket to clean up this |
Attachment: trac_5792_rebase.patch.gz |
comment:5
OK, I'm convinced. Positive review. The patch has bit-rotted slightly, because I added some more doctests to dirichlet.py in #5727 and then edited it again in #5250. Also I am seeing a doctest failure in modform/ambient_eps.py -- nothing serious, the code expects a TypeError and gets a ValueError. I have done a rebased version which changes the doctest. |
comment:6
Merged trac_5792_rebase.patch in Sage 4.0.alpha0. Cheers, Michael |
Reviewer: David Loeffler |
Author: Craig Citro |
Merged: 4.0.alpha0 |
This is pretty worrying:
So something is going a bit wrong when multiplying trivial_character(16) by another character.
I thought I had fixed this one, as part of #5648: there was a bug with arithmetic operations on characters whose parents had the same moduli but different zeta orders. But it looks like it isn't fixed after all.
Component: modular forms
Keywords: dirichlet characters
Author: Craig Citro
Reviewer: David Loeffler
Merged: 4.0.alpha0
Issue created by migration from https://trac.sagemath.org/ticket/5792
The text was updated successfully, but these errors were encountered: