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
Implement minimal model algorithm #15392
Comments
comment:2
Working with Brian Stout we've translated Alexander Molnar's minimal model algorithm/code to work within Sage. A few minors changes from his original work, but the algorithm remains unchanged. |
comment:3
forgot to include the GPL in the new file the first time Brian - can you please add yourself to authors. |
Author: bhutz |
comment:4
Hello, It is very good that the code is documented and contains references! But there are several problem with the documentation (see sage developer guide).
|
comment:5
Yes, 1,2,4 are all simple changes that need to be made. 3 was waiting to add an additional citation (which I have now) and will be fixed as well. 5 I disagree with. The minimalmodel.py file is not exposed to the user, so neither is affine_minimal. The two functions exposed to the user are is_minimal_model() and minimal_model() Part of the original citation is that it is enough for minimal to check affine minimal, so those names should be fine. |
comment:6
Some comments from Alex Molnar: I ... have finally looked through the code. I only glossed the parts that appear unchanged (with the original code side-by-side) and otherwise think the adaptation to projective morphisms looks good. Just two minor comments. In line 206, I think you mean I've updated the patch to make those minor corrections. |
comment:7
I'm just parking some test code here for my own use:
I'm noticing it's awfully slow! I think I tried a similar thing with the magma version and that was quite quick. Initial impression is that this is just a sage problem:
so it looks like just constructing the polynomials is an expensive proposition already. (Ah, I see: there are lots of polynomial rings constructed inside functions. That shouldn't happen) Some possible packaging problems:
|
Attachment: trac15392_referee.patch.gz Some suggested improvements |
comment:8
I've attached a "patch" with some suggested improvements. With that version, I was able to check the minimality of There's still the naming of the file and of the routines to be considered. The code itself seems fine. I've run it by giving it (known) minimal maps from the tables referred to above, conjugating by random transformations, and seeing if the minimal model returned has the same resultant (up to sign) as the original, and I didn't find problems. (I noticed there's a doctest failing for |
comment:9
Those changes look good. I have thought about the naming and see your point on the file name. Although, I'm inclined to be optimistic for the future and call it I'm also happy to call the function Yes. we should just update the doctest as well as we made our best guess as to what a reasonable test was for the individual functions. I can fold the patches together and make these changes unless you want to use your |
comment:10
I went to fold this together and make the other changes, but your patch doesn't apply on my system. Could you double check your patch? I'm still using 5.12, but it shouldn't matter since these are all changing the new |
Attachment: minimal_model.py.gz attached file (due to failing patches) |
comment:11
Replying to @bhutz:
OK, back to basics then. You may be aware that sage is in the middle of changing the source control system. I'm working on the git version and have no idea how to get a HG patch out of it (importing hg patches doesn't seem to be a problem) Attached is the file that resulted from my editing. You should be able to get out of that whatever you want by just replacing the file and let your source control system of choice figure out what the changes are. |
comment:12
Yes, that would certainly do it. In the near future I'll be switching over to git, I just haven't done it yet. New patch attached with your changes, the names changes, and the doctest fixed. apply trac_15392_minimal_model.patch |
comment:13
apply trac_15392_minimal_model.patch |
comment:14
Looks good to me. Incidentally, the name Some very small points: The fact that
doesn't work seems a little strange. Shouldn't it be Certainly in the doctest:
should refer to the keyword argument by keyword, i.e.,
A "positional" false is rather unclear here, even though it works. Finally (and this is for another ticket): If we're "minimizing" rational transformations, shouldn't we also be "reducing" them, i.e., compute an SL(2,Z) transformation that makes the coefficients small? The most simple approach would be to "reduce" the binary form describing the fixed points or (if that's too degenerate) the points of period n for some small n. See [Stoll, Michael; Cremona, John E., On the reduction theory of binary forms. J. Reine Angew. Math. 565 (2003), 79–99.], which is fairly easy to implement and which would be useful to have in sage anyway. |
comment:15
Having the default be False is fine and is now changed. I do have the two optional parameters as positional that is why it is positional in the doctest. It sounds like you think this should be Yes, getting the reduced form would be nice and I'll add it to the dynamics todo list on the wiki. |
comment:16
Replying to @bhutz:
No, in Python, all named arguments can be addressed via keyword. So I wasn't suggesting changing the code, only using the doctest to encourage addressing this option by key. If you prefer, you can still address it by position in your own code. It's just that
isn't very self-documenting. I think the patch update didn't quite work. Do you want to stick with |
comment:17
ok. That's easy enough to change and is done in this version. I forgot to qrefresh before, but the correct one should be up. |
comment:18
Good with me. To repeat: I did try the code quite extensively on more or less random examples, where the code has to do non-trivial work and I didn't catch it on any inconsistencies. |
Changed author from bhutz to Ben Hutz |
Reviewer: Nils Bruin |
comment:21
Patch hasn't changed, so I don't think "review" is necessary. This is just admin to keep Jeroen's job manageable. |
comment:22
|
Work Issues: docbuild |
comment:23
hmm...Since I using the same references in two different functions it is giving the warning. I'm not 100% sure what the procedure is here. In looking at some of the toric variety code, it seems to be the case to put the reference listing in one place and then use So then I've moved the |
Dependencies: #14219 |
Changed work issues from docbuild to rebase |
comment:24
Please rebase the patch to sage-5.13.beta4 or later. |
comment:25
Yes, sorry, I should have realized. Even though there is no functionality dependency, they do modify the same file. The new version is rebased. |
comment:26
|
comment:27
Attachment: trac_15392_minimal_model.patch.gz ok. I fixed that typo in the test and I've doubled checked that the doctests and the docbuild pass on my system. |
comment:28
OK, it works now. Nils, can you do the final review? |
Changed work issues from rebase to none |
comment:30
How many reviews do we need? |
Merged: sage-5.13.rc0 |
Changed author from Ben Hutz to Benjamin Hutz |
Changed author from Benjamin Hutz to Ben Hutz |
Bruin-Molnar published an algorithm to compute the minimal model of a morphism on P1, "Minimal models for rational functions in a dynamical setting".
Translate their algorithm and code to work with the existing dynamical framework
Apply:
Depends on #14219
Component: algebraic geometry
Keywords: sage-days55
Author: Ben Hutz
Reviewer: Nils Bruin
Merged: sage-5.13.rc0
Issue created by migration from https://trac.sagemath.org/ticket/15392
The text was updated successfully, but these errors were encountered: