Skip to content
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

New method to convert toric divisors into Weil divisors #3076

Merged

Conversation

HechtiDerLachs
Copy link
Collaborator

@lkastner : After your explanations this morning I tried to implement what we talked about. However, when building the divisor locally, the MODULE_GENERATORS seem to not lay in the weight_cone of the affine variety! Then solve_mixed returns empty results and I can't proceed.

I left this as a work in progress. Could you take a look?

@HechtiDerLachs HechtiDerLachs marked this pull request as draft December 7, 2023 12:11
@lkastner
Copy link
Member

lkastner commented Dec 7, 2023

Can you post a testcase? In general:

julia> ntv = normal_toric_variety(positive_hull([1]))
Normal toric variety

julia> td1 = toric_divisor(ntv, [-1])
Torus-invariant, non-prime divisor on a normal toric variety

julia> td1.polymake_divisor.MODULE_GENERATORS
pm::Matrix<pm::Integer>
1


julia> td0 = toric_divisor(ntv, [1])
Torus-invariant, prime divisor on a normal toric variety

julia> td0.polymake_divisor.MODULE_GENERATORS
pm::Matrix<pm::Integer>
-1

This means that the divisors we talked about with +1 will correspond to fractional ideals, and those with -1 correspond to actual ideals. Maybe that clears up the confusion?

b[j, 1] = ZZ(A[i, j])
end
@show transpose(hb)
@show b
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the part of the code I was talking about. The example I was running was:

IP = projective_space(NormalToricVariety, 2)
Oscar._weil_divisor_via_polymake(IP, elem_type(ZZ)[1, 0, 0])

@HechtiDerLachs
Copy link
Collaborator Author

@lkastner : Yes, thanks! That must have been the issue. Sorry for not posting the example code earlier. My connection was lost when I wrote my original messages.

I will try again with your suggestions this afternoon.

@HechtiDerLachs HechtiDerLachs marked this pull request as ready for review February 7, 2024 15:27
@HechtiDerLachs HechtiDerLachs changed the title WIP on new method to convert toric divisors into Weil divisors. New method to convert toric divisors into Weil divisors Feb 7, 2024
@HechtiDerLachs
Copy link
Collaborator Author

Oops... Looks like we need to go through the sign convention once more. Tomorrow, then.

continue
function _torusinvariant_weil_divisors(X::NormalToricVariety; check::Bool=false, algorithm::Symbol=:via_polymake)
return get_attribute!(X, :_torusinvariant_weil_divisors) do
ray_list = rays(polyhedral_fan(X))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand this function works as long as X is simplicial? So maybe:

Suggested change
ray_list = rays(polyhedral_fan(X))
@req is_simplicial(X) "Variety must be simplicial"
ray_list = rays(polyhedral_fan(X))

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @lkastner is the right person to ask. If this applies, we should add an @check.

end

function _ideal_sheaf_via_polymake(X::NormalToricVariety, c::Vector{ZZRingElem}; check::Bool=false)
# Input:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise here:

Suggested change
# Input:
@req is_simpicial(X) "Variety must be simplicial"
# Input:

set_attribute!(td, :underlying_divisor=>result)
return result
function underlying_divisor(td::ToricDivisor; check::Bool=false, algorithm::Symbol=:direct)
return get_attribute!(td, :underlying_divisor) do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could likewise have a check here for a simplicial toric variety, but this will be triggered by the other methods later down this method anyways, unless I am mistaken.


@test K1 == K2
@test K1 == K0
@test K2 == K0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this last line necessary? In theory, K1 == K2 and K0 == K1 implies K0 == K2. Maybe this is also true in OSCAR (for deeper reasons)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These trigger different calls for the comparison. So they test different code, indeed.

Copy link
Member

@HereAround HereAround left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this @HechtiDerLachs . It seems that the doctests now complete (other than nightly), so I assume the sign error has been fixed. Great!

I left a few minor comments (nitpicks) above.

Copy link

codecov bot commented Feb 8, 2024

Codecov Report

Merging #3076 (f851cf6) into master (8ded0df) will increase coverage by 0.01%.
Report is 2 commits behind head on master.
The diff coverage is 92.20%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3076      +/-   ##
==========================================
+ Coverage   81.80%   81.81%   +0.01%     
==========================================
  Files         556      556              
  Lines       74146    74317     +171     
==========================================
+ Hits        60654    60805     +151     
- Misses      13492    13512      +20     
Files Coverage Δ
experimental/Schemes/AlgebraicCycles.jl 76.37% <100.00%> (+0.84%) ⬆️
...imental/Schemes/NormalToricVarieties/attributes.jl 95.23% <95.00%> (-4.77%) ⬇️
experimental/Schemes/ToricDivisors/attributes.jl 84.21% <81.25%> (-15.79%) ⬇️

... and 4 files with indirect coverage changes

@HereAround HereAround merged commit a0913ed into oscar-system:master Feb 8, 2024
22 of 23 checks passed
ooinaruhugh pushed a commit to ooinaruhugh/Oscar.jl that referenced this pull request Feb 15, 2024
…#3076)

[ToricSchemes] Extend conversion of toric divisors into (scheme theoretic) Weil divisors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants