-
Notifications
You must be signed in to change notification settings - Fork 126
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
ToricVarieties: Faster Stanley-Reisner ideal, (default) coefficient ring, names for homogeneous variables and fmpz-valued rays from polymake #939
Conversation
57a1e92
to
54df70c
Compare
@thofma I just force pushed and thereby accidentally removed the commit with your suggested change. I amended it to the latest commit, but the "co-authored by" text is gone. I could try to add this by hand if you care. Sorry about that. |
No worries :) |
You could replace |
On Mon, Jan 03, 2022 at 08:44:13AM -0800, Martin Bies wrote:
@HereAround commented on this pull request.
> +
+# Examples
+```jdoctest
+julia> p2 = NormalToricVariety(normal_fan(Oscar.simplex(2)))
+A normal, non-affine, smooth, projective, gorenstein, q-gorenstein, fano, 2-dimensional toric variety without torusfactor
+
+julia> set_cox_ring(p2, "u1, u2, u3")
+
+julia> cox_ring(p2, "u1, u2, u3")
+(Multivariate Polynomial Ring in u1, u2, u3 over Rational Field graded by
+ u1 -> [0 0 1]
+ u2 -> [0 0 1]
+ u3 -> [0 0 1], MPolyElem_dec{fmpq, fmpq_mpoly}[u1, u2, u3])
+```
+"""
+function set_cox_ring(v::AbstractNormalToricVariety, var_list::Vector{String})
Thank you!
Cannot work, "u1, u2, u3" is of wrong type
…
--
Reply to this email directly or view it on GitHub:
#939 (comment)
You are receiving this because you are subscribed to this thread.
Message ID: ***@***.***>
|
54df70c
to
a3dd2f8
Compare
Thank you! |
a3dd2f8
to
00e4eff
Compare
As already proposed by @micjoswig , it would seem that we should simply allow an additional argument, with which one can specify if the variety is to be constructed over ZZ, QQ, F_p... I propose QQ as default. |
Your missing the point, my suggestion allows gradings...
…On Tue, 4 Jan 2022, 18:05 Martin Bies, ***@***.***> wrote:
You could replace FmpzMPolyRing by 'MPolyRing{fmpz}', try
supertype(FmpzMPolyRing) followed by subtypes(ans). This will cover both
graded and non-graded rings. The QQ vs ZZ: it really depends what you want
to do with it. Any classical commutative algebra (Groebner and friends) and
you're sunk when using ZZ. Combinatorcs and easyly moving to FF_p, then ZZ
is better. The fact that the generators of the ideal are in ZZ[x] is
irrelevant as this is true for all ideals...
As already proposed by @micjoswig <https://github.com/micjoswig> , it
would seem that we should simply allow an additional argument, with which
one can specify if the variety is to be constructed over ZZ, QQ, F_p... I
propose QQ as default.
—
Reply to this email directly, view it on GitHub
<#939 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA36CV4MBLTBLLEA3RF3EALUUMSD5ANCNFSM5LFRGOQQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
Well, truth is, the quotient is usually more important than the ideal; so there is a difference. I am absolutely in favor of picking QQ coeffs for (the cohomology rings of) the toric varieties. As far as the Cox ring is concerned, I'd suggest QQ[x1,x2,...] as the default. Of course, we need options for gradings and possibly other rings. The interface for the simplicial complexes should be similar. While I have a slight preference to make ZZ[x1,x2,...] the default ring, I do not insist. An argument in favor of QQ[x1,x2,...] here, too, would be that this would make it less likely for a user to do something stupid (with respect to computational resources). At any rate, here I do need (at least) the option to specify, e.g., ZZ[x1,x2,...] when I mean it. |
The rays of a polyhedral fan or cone are usually considered in QQ (and not in ZZ) as this is required for any convex hull computations, and to retrieve them as a fmpq matrix you can use: m = vector_matrix(rays(fan(v))) There is probably some way to eliminate the denominators in a fmpq matrix to get a fmpz matrix (instead of using Edit: We could probably also add something like |
00e4eff
to
411da42
Compare
411da42
to
38105b9
Compare
I have just updated this PR and hope that it addresses all points and issues made in #932. Hence, I marked it ready for review. Let me summarize the changes:
cc: @fingolfin and @thofma |
|
||
Return the Stanley-Reisner ideal of the abstract simplicial complex `K` in the given ring `R`. | ||
This method is tailor-made to accept the graded Cox ring of a toric variety. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No new line or an example :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I will adjust this upon resolving the points mentioned below (regarding two methods, integers as coefficients...). More below.
There are now two methods
and
right? Does the docstring of the first method needs to be updated or do these two methods really have different assumptions on the input? |
function stanley_reisner_ideal(R::MPolyRing{fmpq}, K::SimplicialComplex) in Forcing rational coefficients here is unwanted! |
…_surface -> Cox ring not set upon construction -> User can choose coordinate_names and coefficient_ring
-> Suggest coordinate names by setting the corresponding attribute -> cox_ring not set so user can overwrite this choice and set coefficient_ring
4759c94
to
d1d014d
Compare
…s of ToricVarieties -> Fix issue reported by @fieker in oscar-system#932
…f variety known Co-authored-by: Benjamin Lorenz <benlorenz@users.noreply.github.com>
d1d014d
to
f46b10a
Compare
Co-authored-by: Lars Kastner <lkastner@users.noreply.github.com>
@lkastner: I have updated this PR as we discussed earlier this week.
|
Done. |
Great work, thank you. Let's discuss everything else after this is merged, since it is very large already as you said. |
@fingolfin Should this then only be merged or squash+merge? |
Do the individual commits yield running versions of Oscar and do you want to preserve the individual commits? If yes, merge, otherwise, squash+merge. |
My goal is to make sure that all commits yield a running version. However, due to the long runtime of the tests (in particular the documentation), I have not explicitly checked all commits, but only some during development. Feel free to squash if that seems more reasonable. |
…ing, names for homogeneous variables and fmpz-valued rays from polymake (oscar-system#939) * ToricVarieties: Initialize list of generators with correct type * ToricVarieties: Change homogeneous variables of Cox ring: x[k] -> xk * ToricVarieties: Change order of homogeneous variables for del Pezzo surfaces * ToricVarieties: Ask for user input for blowup_on_ith_torus_orbit * ToricVarieties: Add set_coordinate_names and coordinate_names * ToricVarieties: Cox ring uses coordinate_names(v) as indeterminates * ToricVarieties: Add set_coefficient_ring and coefficient_ring * ToricVarieties: Cox ring uses coefficient_ring(v) as coefficient ring * ToricVarieties: Relax construction of projective_space and Hirzebruch_surface -> Cox ring not set upon construction -> User can choose coordinate_names and coefficient_ring * ToricVarieties: Relax construction of del_pezzo surfaces -> Suggest coordinate names by setting the corresponding attribute -> cox_ring not set so user can overwrite this choice and set coefficient_ring * ToricVarieties: toric_ideal uses coefficient_ring * ToricVarieties: Blowup_on_ith_minimal_torus_orbit uses coefficient_ring * ToricVarieties: Add test for set_coordinate_names and set_coefficient_ring * ToricVarieties: Print coefficient ring in Base.show * ToricVarieties: Use matrix(ZZ, rays(fan(v))) and nrays to process fans of ToricVarieties -> Fix issue reported by @fieker in oscar-system#932 * ToricVarieties: Cache polyhedron of ToricVariety upon construction * ToricVarieties: Compute SR-Ideal via simplicial complex if polytope of variety known Co-authored-by: Benjamin Lorenz <benlorenz@users.noreply.github.com> * ToricVarieties: Extend documentation on default coefficient_ring and coordinate_names * ToricVarieties: More efficient simplex computation Co-authored-by: Lars Kastner <lkastner@users.noreply.github.com> Co-authored-by: Benjamin Lorenz <benlorenz@users.noreply.github.com> Co-authored-by: Lars Kastner <lkastner@users.noreply.github.com>
This PR aims towards resolving the discussion in #932. In the current form, I find this draft NOT satisfying. I am certain that other people will find more issues. Here is what I see at this point:
As @fieker reported, there seem to be an issue with the following function whenever we have large/huge rays:
Specifically, the conversion into
Matrix{Int}
can then fail. Generally speaking, it should be possible to replace this line viarays(fan(v))
. This is currently not possible, because the return value is thenPolymake.Rationals
, while one should expect to havefmpz
. As a temporary fix, I added a corresponding function in 01d8f48. @lkastner and @micjoswig: What are your thoughts on this?To compute the Stanley-Reisner ideal via a simplicial complex, we can first focus on projective varieties, so that the fan is the normal fan of a polyhedron
P
. We do not have a function which computes this polyhedron yet. Is there functionality for this somewhere? If yes, I could not (yet) find it. A temporary fix is to cache the polyhedron, if the variety is created from one: 4abd464Next, one could hope to call
stanley_reisner_ideal(S,K)
, with S the graded (!) Cox ring and K the simplicial complex in question. This is not possible because currently only non-graded rings overZ
are accepted as input:In particular, the expression
ideal([ R([1], [_characteristic_vector(f,n)]) for f in minimal_nonfaces(K) ])
cannot seem to be evaluated for a graded ringR
. Ring experts, please comment.The following change would work, but is probably not robust enough (see 10cd389):
Finally, I change the homogeneous coordinate from
x[i]
toxi
. This looks nicer, but has other drawbacks (e.g. as they cannot be generated programmatically as @fieker pointed out). The relevant commits are:x[i]
toxi
.ei
. (Not sufficiently robust at this point, in my opinion.)Last but not least, it would appear that
Z
,Q
as base rings have each advantages/disadvantages. No resolution for this yet.Finally, to rebase more easily, this PR contains the changes of #929 and #940, which I hope are both a lot less critical and can be merged very soon.