-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
is_galois_relative() not always right #9390
Comments
comment:1
This fails because the present definition for relative number fields:
is completely wrong. In the case above
while the relative degree is 3. Clearly the Homset contains all endomorphisms of of L, not just the relative ones. One obvious possibility would be to count those endomorphisms which fix the base field. But the following might be better
I'll do some testing and post a patch later today. |
comment:3
After a rather longer than expected delay, I'm attaching a patch which gives correct results for |
Attachment: trac_9390.patch.gz |
comment:4
Nice, that is a lot faster, and correct. There is one thing I don't like though: you introduced a difference between With your patch on Sage 4.6.1.alpha2:
Without your patch, it is NotImplementedError, NotImplementedError, False, so your patch is a definite improvement, but could be better. I think it would be better to put your new code in PS grammar: line 1177 of number_field_rel.py after the patch, previous should be previously (or simply replace the line by "Check that bug #9390 is fixed::") |
Author: Francis Clarke |
Reviewer: Marco Streng |
comment:5
Replying to @mstreng:
I've done this in a new replacement patch, and dealt with the grammatical point you raised. It was also necessary to make a minor change to an unconnected doctest. This is because of PARI's inconsistent behaviour when choosing ideal generators. The same issue arose in #5842. |
Attachment: trac_9390-replacement.patch.gz Replaces previous patch |
comment:6
On which Sage version is this a speedup for is_galois_absolute? With Sage 4.6.1.alpha2 and no patches
Same version, but with your patch:
So you did correct (and apparently speed up) is_galois_relative. However, it seems to slow down is_galois and is_galois_absolute. This gets worse if you use is_galois multiple times for the same field, as the old version uses cached data and your version doesn't: Without patch:
With patch:
I'm very sorry for not noticing this earlier and for letting you do make the changes you did after my first review. On the other hand, my suggestion allowed for a good test of your code, as is_galois is ubiquitous:
Maybe it is better to stick with the is_galois_relative correction only. Also, if you know about cached methods, then perhaps you could make is_galois_relative and is_galois_absolute cached while you're at it. You can also make a distinction in is_galois between degree <= 11 (use the old method) and degree > 11 (old method only works if KASH is installed, use your method). I suppose it is good to still let is_galois_absolute() simply call absolute_field().is_galois(). |
comment:7
Replying to @mstreng:
I'm sorry about this. I don't know how I convinced myself that the absolute version was faster.
I can't reproduce this. Actually
The new patch implements this, except it doesn't do any caching. |
Replaces previous two patches |
comment:8
Attachment: trac_9390-2nd_replacement.patch.gz Replying to @sagetrac-fwclarke:
How could you be so sure about that? The timeout is caused by the long test |
comment:9
Replying to @mstreng:
My mistake was that I was using 4.6. The long test in question was introduced in #8451 which was merged in sage-4.6.1.alpha2. I haven't checked it fully, but it looks like in this case the function |
comment:10
Strange: I remove all patches, build, and the long gal_reps.py test is fine, then I apply your latest patch, build, and it times out again after 1800 seconds. The only thing I could think of is that (somewhere in a function called by Or there is something wrong with my sage installation. Can anyone reproduce this increase in test time? (4.6.1.alpha2 with no other patches applied) For buildbot: Apply trac_9390-2nd_replacement.patch |
comment:11
Replying to @mstreng:
Same problem with a fresh install. Actually, something fishy happens in image_type(7). Without your patch, it outputs Sorry, but that means this patch can't go in the way it is: either fix gal_reps or don't touch is_galois. |
comment:12
With the #8451 patch, and with
deriving from the following lines in
So what's happening is that Anyway, as you suggest, the way forward is a minimal patch which only changes |
Attachment: trac_9390-3rd_replacement.patch.gz Replaces previous three patches |
comment:13
Too bad about the improvements to is_galois. I suppose that code from trac_9390-2nd_replacement.patch can go into a new ticket, if someone wants to revise image_type. Apply trac_9390-3rd_replacement.patch |
Merged: sage-4.6.2.alpha1 |
In 4.4.4 the following code produces a number field which is Galois over the rationals but (allegedly) not over an intermediate field.
CC: @sagetrac-cturner @mstreng
Component: number fields
Keywords: galois extension
Author: Francis Clarke
Reviewer: Marco Streng
Merged: sage-4.6.2.alpha1
Issue created by migration from https://trac.sagemath.org/ticket/9390
The text was updated successfully, but these errors were encountered: