-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
Add support for rational polyhedral fans #8987
Comments
Author: Andrey Novoseltsev |
This comment has been minimized.
This comment has been minimized.
comment:2
I will make some adjustments to this module following discussion here: |
Switch to toric lattices. |
This comment has been minimized.
This comment has been minimized.
comment:3
Attachment: trac_8987_add_support_for_rational_polyhedral_fans.patch.gz New version of the patch using toric lattices from #9062. Switch of caching technique to allow efficient extension of class hierarchy is still pending. |
comment:4
Looks good so far. Adding the extra caching that was discussed on the mailinglist could be done later. Let me know when you want me to review the patches. |
comment:5
Hi Volker, If you don't mind some delay of caching, then cones are ready for review. In fans module I will add today or tomorrow derived classes EnhancedCone(Cone_of_fan) and EnhancedFan(RationalPolyhedralFan), with the syntax discussed on sage-devel before. For now they will make efficient copies of existing fans and cones, later they will be smoothly transitions to shared caching. Since these classes will be on top of the existing framework, the rest is ready to review. In fact, I can make a separate patch adding them in a new ticket, rather than modifying again patches here. Marking everything as ready!!! Thank you! |
comment:6
The second patch adds classes that will support cones and fans for domain and codomain of morphisms. While working on it, I moved the actual computation of the cone lattice to |
Attachment: trac_8987_add_enhanced_cones_and_fans.patch.gz Apply after the big patch. |
Reviewer: Volker Braun |
comment:7
Maybe I'm missing something, but is there a reason why comparison of cones depends on the ray ordering?
It seems more natural to compare |
comment:8
Replying to @vbraun:
This is done like this:
One reason for such behaviour of Another reason is consistency with the implementation of fans. For fans checking mathematical equality is a bit more tedious (although still can be done quickly using sorted lists for rays and cones, see Maybe these arguments are not very strong, but since there is a way to check equality in both senses, I think that it should be fine. The plan is also to have equivalence check relevant for toric varieties, i.e. up to Would you like me to add some comments on this behaviour to the "main" documentation of cone and fan modules? It is already described in |
comment:9
Also, note that
I would argue that is is ok to treat fans and cones a bit different, one will compare cones often but fans only seldomly. I'm happy with comparison of fans to depend on the order of the rays and generating cones, otherwise all derived quantities (like cohomology generators of toric varieties) will not be equal (only isomorphic). But for
should have raised an exception. In normal use you'll never want to type in all the cones of the fan since there are so many. But its easy to get confused and add a cone that turns out to be not a generating cone, and its nice to catch this when generating the There is certainly a need for a function that extracts the generating cones from a collection of cones, but I don't think it should be implicit in the Fan constructor.
There are similar methods to this one that we probably want to add later, so let me just throw out some names:
I also think that
The functionality of Let me know what you think... |
comment:10
I noticed that |
comment:11
Replying to @vbraun:
You got a point here, I don't like this behaviour...
There was no sorting, rays were determined first as a set (union of ray sets of all cones) and then converted to a tuple. I am not sure if the same set will always lead to the same tuple or it depends on something. I definitely don't want to force sorting - if a user gives rays in a specific order, then (s)he probably wants them in that order.
In general, I agree, but it may potentially lead to As I understand, it is not enough to just add Yeah... I think my position is: I will do this change if you still want it after arguments above, but I am very against it, especially since a method performing mathematical equality check is provided. A compromise is to add
It would be also nice, perhaps, to be able to check points in such a way, i.e. if a point is in the support of a fan.
My intention was to write a fan constructor that will construct a fan if at all possible. (Similarly, the cone constructor by default will discard non-generating rays.) One may, for example, start with some fan and add more cones to it. In this case some of the old generating cones may become unnecessary. Or, if cones of a fan come one by one from a certain procedure (e.g. in computing GKZ decomposition) and it is not known in advance how to easily select generating cones (e.g. all generating cones are full-dimensional for complete fans), it would be nice if the fan constructor could automatically select necessary cones. If you really against silent discard, we can perhaps either add a warning about a non-generating cone present, or a default parameter
OK.
Note that these are inherited from plain cones. However, they are likely to be
I don't like the name. I guess it means that
What exactly do you mean by
Is this name standard? I see that it may be convenient to have such a function, but I am not sure I would guess from the name what it does.
I think it is just a helper and can go to
I disagree, because
Agreed.
I was tempted to say that
will do exactly this, but it will not since Well, I think at least
should do this work, even if it may fail to do so now because there is no particular sorting of 1-dimensional cones in the lattice. This actually seriously bugs me, since it was very annoying in
Can I remove
Or, as I propose
Let me know what you think now! I am switching this ticket back to needs work. Regarding the last two tickets in the sequence - while I am working on this one, you can probably go ahead and review them too in the sense of comments. They will likely need some minor changes after updating this patch, but I currently don't plan to do anything else unless you request it. |
comment:12
Replying to @vbraun:
Yes. I tried to make cones and fans better compared to |
comment:13
Replying to @novoselt:
I think the integer vectors get sorted lexicographically by their entries, and I think the rays inherit that. So the result should be deterministic :-)
I think that right now The "mathematical" comparison of the cones is only slow if they are not strictly convex, so I don't think that would be a big problem. Also, in the non-strict case one could work with facet normals which might be cached already... I'm not necessarily insisting that we do it that way, but just throwing out some options.
Oww I didn't notice that... Can we have it return the 1-cones in the same order as the rays of the fan?
Fine by me! |
comment:45
I think the patch(es) are in great shape now. Positive review! |
comment:46
Thank you! For the release manager: apply all patches in the order listed in the ticket. |
Attachment: trac_8987_cmp_fix.patch.gz |
comment:47
I made a systematic mistake in doctests of |
comment:49
Looks good! |
comment:50
This patch won't apply without #8986, which is currently at "needs work", so it can't be merged at present. |
Merged: sage-4.5.2.alpha0 |
This patch is a part of the following series adding support for cones/fans and toric varieties to Sage:
Prerequisites:
#8675 - Remove
AmbientSpace._constructor
and fix consequences#8682 - Improve
AlgebraicScheme_subscheme.__init__
andAmbientSpace._validate
#8694 - Improve schemes printing and LaTeXing
#8934 - Trivial bug in computing faces of non-full-dimensional lattice polytopes
#8936 - Expose facet inequalities for lattice polytopes
#8941 -
_latex_
andorigin
for lattice polytopesMain patches adding new modules:
#9062 - Add support for toric lattices
#8986 - Add support for convex rational polyhedral cones
#8987 - Add support for rational polyhedral fans (this ticket now also has a bug fix #9188 as a prerequisite)
#8988 - Add support for toric varieties
#8989 - Add support for Fano toric varieties
Everything was tested on sage.math using sage-4.4.2.rc0.
CC: @vbraun @loefflerd
Component: geometry
Author: Andrey Novoseltsev
Reviewer: Volker Braun
Merged: sage-4.5.2.alpha0
Issue created by migration from https://trac.sagemath.org/ticket/8987
The text was updated successfully, but these errors were encountered: