-
Notifications
You must be signed in to change notification settings - Fork 129
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: Several bugfixes #1909
Conversation
f3b2536
to
9bbc6ab
Compare
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.
Looks good to me, a few very minor suggestions
true | ||
``` | ||
""" | ||
@attr Bool is_effective(td::ToricDivisor) = pm_tdivisor(td).EFFECTIVE | ||
@attr Bool is_effective(td::ToricDivisor) = all(c -> (c >= 0), coefficients(td)) |
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.
So what did the old code compute then?!
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.
It checked whether the toric divisor td
is linearly equivalent to an effective divisor. In other words, it checked whether there exists a principal divisor p
s.t. td + p
is effective.
Standard constructor must not PERMUTE rays to form map from character lattice to Weil divisors (Co)Domains of maps set by default constructors must match the corresponding groups of the variety
It checks if a divisor is lin. equivalent to an effective divisor. But it should check if the divisor is effective.
Co-authored-by: Max Horn <max@quendi.de>
The error in the required
For
Both files have not been touched in this PR and all tests (except for the time-out on macOS - cf. #1888) succeeded yesterday. I am not sure why I am seeing this error. Any suggestions @thofma and @fieker? Is this possibly related to #1912? |
The
The Both errors will probably go away when re-running the tests. |
Thank you for elaborating. Let me rerun the tests... |
A quick tip for the next time: Instead of re-opening the ticket you can also go to the PS: I have re-run way too many jobs to debug that nightly issue... |
Thank you for the pointer. I shall remember that now. Indeed, this is the better option. (I actually recalled that option, but could not find the corresponding button a few minutes ago... I must have overlooked it. Thank you for telling me where to look.) |
Indeed, after rerunning the tests, all checks pass (other than the time-out for the macOS test). So this is ready for review @lkastner and @fingolfin . Thank you! |
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.
Presetting all those properties for e.g. Hirzebruch surfaces always makes me a bit nervous, since it essentially makes it useless to have tests on these. I am a bit afraid that at some point we will run into situations where we have a bug, but it won't manifest for such standard constructions, even though it should, since we are assigning so many properties manually. Is it just me? Is there some kind of OSCAR policy regarding this?
Aside from that, great work.
@doc Markdown.doc""" | ||
is_linearly_equivalent_to_effective_toric_divisor(td::ToricDivisor) | ||
|
||
Determine whether the toric divisor `td` is linearly equivalent to an effective toric divisor. | ||
|
||
# Examples | ||
```jldoctest | ||
julia> P2 = projective_space(NormalToricVariety,2) | ||
A normal, non-affine, smooth, projective, gorenstein, fano, 2-dimensional toric variety without torusfactor | ||
|
||
julia> td = ToricDivisor(P2, [1,-1,0]) | ||
A torus-invariant, non-prime divisor on a normal toric variety | ||
|
||
julia> is_effective(td) | ||
false | ||
|
||
julia> is_linearly_equivalent_to_effective_toric_divisor(td) | ||
true | ||
``` | ||
""" | ||
@attr Bool is_linearly_equivalent_to_effective_toric_divisor(td::ToricDivisor) = pm_tdivisor(td).EFFECTIVE | ||
export is_linearly_equivalent_to_effective_toric_divisor |
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.
Do we really want this? Can't one just use the class construction? I mean we could end up with tons of is_linearly_equivalent_to_*
functions. Is this something we want to avoid or would it be ok?
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.
I thought this might be convenient, but on second thought you might be right. As I see it (now), we could remove this.
I agree that this could happen. The first bug above was sort-of similar: Issue for the default/standard constructor About feeling uneasy: Personally, I am not too worried. Originally, the intention was to preset properties for speed-up. But then, my feeling is that we do not gain too much from this (but I have not done any benchmarking) and so would be happy to remove them. |
Frederik Witt reported the following bug to me:
The two matrices should be identical, but apparently are not. The rows are exchanged.
In the constructor for the Hirzebruch surface, an attribute was set incorrectly. This is the root cause for this behavior. This PR fixes this in the constructor for the projective space, Hirzebruch and del Pezzo surfaces.
While investigating this issue, I also noticed a similar glitch. For a smooth toric variety, we proceed as follows:
map_from_torusinvariant_weil_divisor_group_to_class_group
.map_from_cartier_divisor_group_to_picard_group
as being identical tomap_from_torusinvariant_weil_divisor_group_to_class_group
.It then follows, that Picard group and Class group of the smooth variety in question are identical (as in are the exact same object in the memory of the computer). To me this seems odd, even though Picard and Class group are isomorphic in such a setting. So I have modified the code such that they are isomorphic but not identical.
Another bug that Frederik Witt reported was the following:
A toric Weil divisor is effective iff all of its coefficients are non-negative. So
td
is not effective, in contrast to the output by OSCAR. I have done the following:is_effective
function of a toric divisor: It now checks if all coefficients are non-negative. If so, it returnstrue
and otherwisefalse
.is_linearly_equivalent_to_effective_toric_divsior
: This constructs the corresponding toric divisor inPolymake
and then checks if this divisor is linearly equivalent to an effective toric divisor. (This is the behavior ofis_effective
before this PR.)is_effective
for toric divisor classes: It finds a toric divisor in the divisor class at hand and then checks if this divisor is linearly equivalent to an effective toric divisor.Tests and documentation for the new functions have been added. Those for the old functions have been modified.