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
Bug in global_height function #11758
Comments
comment:3
This looks like a valid bug to me (the author, sorry). Would you (dkrumm) like to make a patch fixing it, with your example as a doctest? |
comment:4
Replying to @JohnCremona:
Yes, I'd like to do that. I'm trying to figure out how to make a patch (I'm completely new to Sage development), but it should not take too long. In a related question, I have my own height function that I use instead of this one, in which the result is guaranteed to be correct within any given accuracy, and I think the current height in Sage does not (the precision in the input refers not to the accuracy of the output, but to the accuracy used in computing the embeddings of the number field). Do you think it would be good to try to include this height function into Sage? |
comment:5
Replying to @sagetrac-dkrumm:
Definitely. Do it! But on this ticket, limit the patch to fixing the bug (with doctest), and then create a new ticket for the better function, with a corss-reference from here. |
comment:6
Replying to @JohnCremona:
I hope I've created the patch correctly. Sorry, I don't know what doctest is. |
comment:7
Replying to @sagetrac-dkrumm:
A doctest is some test contained in the documentation of a function. Just do:
You should now see documentation on how to use the global height. The examples like:
given there are called doctests since they are used for automated testing of the sage library (see http://www.sagemath.org/doc/developer/doctesting.html). All those examples are tested and should produce the shown output before a patch is accepted. In this case it means that the doctests have to change since the answers show are not correct. What john asked is if you could also add your example wich you posted in the description as a test (ofcourse with the new and imporved answers. |
comment:8
Replying to @koffie:
Ok, thanks for the explanation. Unfortunately, I can't put in those examples yet, because my sage library won't build. So even though I've made the changes in the code, I can't get sage to recognize them. I have this problem on my personal computer, and also on the ones in my department.. do you think this problem with Lion and Xcode will be fixed any time soon? |
comment:9
If you have problems building Sage ask questions on sage-devel, not here. Read the developers' guide for instructions on how to write doctests and make patches, etc. And I suggest that you don't post a patch until you have tested it which you obviously cannot do until you have your own development build up and running. |
comment:10
I just added the doctest so that the patch is ready for review. |
Author: David Krumm, Maarten Derickx |
comment:11
Replying to @koffie:
You need to put a proper commit message in the patch |
comment:12
Attachment: trac_11758_global_height.patch.gz Replying to @jdemeyer:
done |
Original patch, with a trivial typo fixed in a docstring. |
comment:13
Attachment: trac_11758_global_height.2.patch.gz The above patch fixes a trivial typo in Maarten's patch. Otherwise everything is fine. Also, Magma gives the same result for both doctests. |
comment:14
Thanks for reviewing. If you review something you should set the reviewer field. And if there are multiple patches you should specify wich to apply. |
This comment has been minimized.
This comment has been minimized.
Reviewer: Frithjof Schulze |
Merged: sage-4.8.alpha5 |
The global_height function for elements of number fields gives incorrect results. Here is an example:
This is incorrect since s and 1/s should have the same height. I'm running Sage 4.7 on Mac OS X 10.6.8.
I believe the reason for the error is explained in the author's comments in the code for this function:
"The absolute logarithmic height of this number field element; that is, the sum of the local heights at all finite and infinite places, with the contributions from the infinite places scaled by the degree to make the result independent of the parent field."
However, it is both the arch. and non-arch. contributions that need to be scaled by the degree.
apply attachment: trac_11758_global_height.2.patch
CC: @JohnCremona @koffie
Component: number theory
Keywords: global height
Author: David Krumm, Maarten Derickx
Reviewer: Frithjof Schulze
Merged: sage-4.8.alpha5
Issue created by migration from https://trac.sagemath.org/ticket/11758
The text was updated successfully, but these errors were encountered: