sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.46k stars 484 forks source link

Toric divisors from fans in sublattices #16334

Open a1031e5c-5e2c-4c90-8ba4-91be67e304df opened 10 years ago

a1031e5c-5e2c-4c90-8ba4-91be67e304df commented 10 years ago

Currently, there's a problem with toric divisors of toric varieties created from fans that live in a sublattice.

The following examples illustrates that:

sage: N = ToricLattice(3)
sage: S = N.submodule([(1,0,0), (0, 1, 0)])
sage: B = S.basis()
sage: cones = [Cone([B[0], B[1]]), Cone([B[1], -B[0]-B[1]]), Cone([-B[0]-B[1], B[0]])]
sage: f = Fan(cones)
sage: X = ToricVariety(f)
sage: X.is_complete()
True
sage: (-X.K()).polyhedron()
A 3-dimensional polyhedron in QQ^3 defined as the convex hull of 3 vertices and 1 line

However, the real polyhedron should be a two-dimensional compact polygon:

sage: (-toric_varieties.P(2).K()).polyhedron()
A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 3 vertices

CC: @vbraun @novoselt @sagetrac-jakobkroeker

Component: algebraic geometry

Keywords: toric

Stopgaps: wrongAnswerMarker

Work Issues: fix inner product between N and M

Author: Jan Keitel

Branch/Commit: u/jkeitel/toric_divisors_sublattice @ 108339b

Reviewer: Andrey Novoseltsev, Volker Braun

Issue created by migration from https://trac.sagemath.org/ticket/16334

a1031e5c-5e2c-4c90-8ba4-91be67e304df commented 10 years ago

Description changed:

--- 
+++ 
@@ -5,12 +5,12 @@

sage: N = ToricLattice(3) sage: S = N.submodule([(1,0,0), (0, 1, 0)]) +sage: B = S.basis() sage: cones = [Cone([B[0], B[1]]), Cone([B[1], -B[0]-B[1]]), Cone([-B[0]-B[1], B[0]])] sage: f = Fan(cones) sage: X = ToricVariety(f) sage: X.is_complete() True -The empty polyhedron in QQ^3 sage: (-X.K()).polyhedron() A 3-dimensional polyhedron in QQ^3 defined as the convex hull of 3 vertices and 1 line

a1031e5c-5e2c-4c90-8ba4-91be67e304df commented 10 years ago
comment:2

Alright, here's a short patch that fixes the problem. I don't know whether it's the best way of working around this, but it's simple and does the trick.

Volker, could you have a look? :)

a1031e5c-5e2c-4c90-8ba4-91be67e304df commented 10 years ago

Branch: u/jkeitel/toric_divisor_sublattice

a1031e5c-5e2c-4c90-8ba4-91be67e304df commented 10 years ago

Description changed:

--- 
+++ 
@@ -20,5 +20,3 @@
 sage: (-toric_varieties.P(2).K()).polyhedron()
 A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 3 vertices

- -I'll attach a branch with a fix soon.

a1031e5c-5e2c-4c90-8ba4-91be67e304df commented 10 years ago

Author: Jan Keitel

a1031e5c-5e2c-4c90-8ba4-91be67e304df commented 10 years ago

Commit: d26cadf

a1031e5c-5e2c-4c90-8ba4-91be67e304df commented 10 years ago

Changed branch from u/jkeitel/toric_divisor_sublattice to u/jkeitel/toric_divisors_sublattice

a1031e5c-5e2c-4c90-8ba4-91be67e304df commented 10 years ago

New commits:

d26cadfFix polyhedron method for toric divisors in sublattices.
novoselt commented 10 years ago
comment:4

I am confused - the polyhedron of the toric variety whose fan is in the lattice N lives in the dual lattice M, why is it intersected with the sublattice where the fan lives?

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 10 years ago

Changed commit from d26cadf to 886225d

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 10 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

886225dUse the correct lattice and adjust doctest.
a1031e5c-5e2c-4c90-8ba4-91be67e304df commented 10 years ago
comment:6

Hi Andrey,

thanks for having a look at this. You're of course right. I've changed the code and am now using a doctest that would give an incorrect result for the previous patch.

Best, Jan

vbraun commented 10 years ago
comment:7

Looks good to me... Andrey, any further thoughts?

vbraun commented 10 years ago

Reviewer: Andrey Novoseltsev, Volker Braun

novoselt commented 10 years ago
comment:8

I think this polyhedron should live in the fan.dual_lattice(), so instead of lifting the generators and taking the intersection with their span (which is something pretty random), the correct approach is to push previously used inequalities into this dual lattice (which is a quotient, so has smaller dimension).

a1031e5c-5e2c-4c90-8ba4-91be67e304df commented 10 years ago
comment:9

Okay, if I understand you correctly, that's actually quite easy to realise. I have a patch that does this and I'll push it tomorrow when I'm back at the institute.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 10 years ago

Changed commit from 886225d to 108339b

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 10 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

21afa61Merge branch 'develop' into toric_divisor_sublattice
108339bTry implementing a proper quotient for the divisor polyhedron.
a1031e5c-5e2c-4c90-8ba4-91be67e304df commented 10 years ago
comment:11

Sorry, it took a bit longer because something else came up. The newest change tries to do what you just suggested, but since polyhedra corresponding to divisors do not necessarily have to be lattice polytopes, it looks a bit clumsy. Could you have a look and check whether there's a nicer way of doing it?

Best, Jan

a1031e5c-5e2c-4c90-8ba4-91be67e304df commented 10 years ago
comment:12

Unfortunately, the diff on trac seems to be broken. Something else has come up and I'm not sure what to do about it.

Consider the following:

sage: N = ToricLattice(4)
sage: S = N.submodule([(1,0,0,0), (0,1,0,0)])
sage: B = S.basis()
sage: S.dual()
2-d lattice, quotient of 4-d lattice M by Sublattice <M(0, 0, 1, 0), M(0, 0, 0, 1)>
sage: S.dual().gens()
(M[0, 1, 0, 0], M[1, 0, 0, 0])
sage: S.gens()
(N(1, 0, 0, 0), N(0, 1, 0, 0))

Usually, we have that ith generator of a lattice is 'dual' (don't know whether that's the right adjective) to the ith generator of the dual lattice. Here, however, there is an additional reordering going on.

As a consequence, we have the following behavior:

sage: cones = [Cone([B[0], B[1]]), Cone([B[1], -3*B[0]-2*B[1]]), Cone([-3*B[0]-2*B[1], B[0]])]
sage: X = ToricVariety(Fan(cones))
sage: p = (-X.K()).polyhedron(); p
A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 3 vertices
sage: p.integral_points()
((-1, -1), (-1, 0), (-1, 1), (-1, 2), (0, -1), (0, 0), (1, -1))
sage: (-X.K()).sections()
(M[-1, -1, 0, 0],
 M[0, -1, 0, 0],
 M[1, -1, 0, 0],
 M[2, -1, 0, 0],
 M[-1, 0, 0, 0],
 M[0, 0, 0, 0],
 M[-1, 1, 0, 0])

which leads directly to this (obviously incorrect, see the z1^-3) output:

sage: (-X.K()).sections_monomials()
(z1^6, z0*z1^3, z0^2, z0^3/z1^3, z1^4*z2, z0*z1*z2, z1^2*z2^2)

What should be changed? Finding the generators of a dual of a lattice? The polyhedron method of the divisor? The monomial method of the divisor?

novoselt commented 10 years ago
comment:13

Just reordering may not be sufficient in more complicated examples.

I think the assumption is that pairing between dual lattices is the "usual dot product", i.e. sum of products of corresponding components. If this is not the case for a particular representation, then everything will go wrong. Solutions are to either set generators of the dual upon construction correctly or set the pairing properly. Given that is natural for pairing, it may be a bit counterintuitive to have `M(1,0) N(0,1) == 1`, so forcing a correct basis seems like a better option.

a1031e5c-5e2c-4c90-8ba4-91be67e304df commented 10 years ago

Work Issues: fix inner product between N and M

ea1d0bf8-c27a-4548-8cb7-de0b1d02441a commented 7 years ago

Stopgaps: wrongAnswerMarker