1 | initial version |
The following did not fit as a comment, so it became an answer. In such cases it is always a good idea to provide a minimal, non-trivial, relevant example, give the expectation, and references for the definition of the involved objects, if not standard. (I was somehow puzzled about the meaning of a "dual toric diagram" and "dual toric fan"... Please give definitions or links to their meanings.)
Of course, sage code that initialize sample data would be wonderful for potential helpers to get immediately in the matter.
If i understand the post, we want the following:
plot
it!)Here is some sample lines of code addressing these points, for more we need more (input).
import pprint
# (0) construct some vertices and the polyhedron determined by them
R = [ 0,
+3, +4, +5,
-3, -4, -5, ]
V = [ (s,t,u)
for (s,t,u) in cartesian_product( [R,R,R] )
if s^2 + t^2 + u^2 == 5^2 ]
P = Polyhedron( vertices = V )
L = P.lattice_polytope()
print "P has the following vertices:"
pprint.pprint( P.vertices_list() )
print "A plot of P..."
P.plot()
# (1) associate the fan of the polyhedron P
F = FaceFan( L )
# (2) plot the fan
print "The fan of the lattice L is as follows..."
F.plot()
print "The rays of the fan F are as follows:"
print F.rays()
# (3) associate the toric variety of the fan
T = ToricVariety( F )
print "A plot of the associated toric variety T..."
T.plot()
# (4) dual fan (?)
# there is only a dual lattice, that i can associate to a given lattice.
# or we may pass from a cone to its dual cone,
# but this is an operation that may map
# disjoint (open) cones to intersecting dual cones.
# example
c = F.cones()[3][0] # first cone in the fan F
print "The rays of the first cone are:\n", c.rays()
plot(c)
cd = c.dual()
print "The rays of its dual cone are:\n", cd.rays()
plot(cd)
Methods of the constructed objects can be detected by using `dir`, e.g. `dir(F)`, or
using in the sage console the TAB-extensions list. (For this, type `F.`, then hit the TAB (twice).)
2 | No.2 Revision |
The following did not fit as a comment, so it became an answer. In such cases it is always a good idea to provide a minimal, non-trivial, relevant example, give the expectation, and references for the definition of the involved objects, if not standard. (I was somehow puzzled about the meaning of a "dual toric diagram" and "dual toric fan"... Please give definitions or links to their meanings.)
Of course, sage code that initialize initializes sample data would be wonderful
for potential helpers to get immediately in the matter.
If i understand the post, we want the following:
plot
it!)Here is some sample lines of code addressing these points, for more we need more (input).
import pprint
# (0) construct some vertices and the polyhedron determined by them
R = [ 0,
+3, +4, +5,
-3, -4, -5, ]
V = [ (s,t,u)
for (s,t,u) in cartesian_product( [R,R,R] )
if s^2 + t^2 + u^2 == 5^2 ]
P = Polyhedron( vertices = V )
L = P.lattice_polytope()
print "P has the following vertices:"
pprint.pprint( P.vertices_list() )
print "A plot of P..."
P.plot()
# (1) associate the fan of the polyhedron P
F = FaceFan( L )
# (2) plot the fan
print "The fan of the lattice L is as follows..."
F.plot()
print "The rays of the fan F are as follows:"
print F.rays()
# (3) associate the toric variety of the fan
T = ToricVariety( F )
print "A plot of the associated toric variety T..."
T.plot()
# (4) dual fan (?)
# there is only a dual lattice, that i can associate to a given lattice.
# or we may pass from a cone to its dual cone,
# but this is an operation that may map
# disjoint (open) cones to intersecting dual cones.
# example
c = F.cones()[3][0] # first cone in the fan F
print "The rays of the first cone are:\n", c.rays()
plot(c)
cd = c.dual()
print "The rays of its dual cone are:\n", cd.rays()
plot(cd)
Methods of the constructed objects can be detected by using `dir`, e.g. `dir(F)`, or
using in the sage console the TAB-extensions list. (For this, type `F.`, then hit the TAB (twice).)
3 | No.3 Revision |
The following did not fit as a comment, so it became an answer. In such cases it is always a good idea to provide a minimal, non-trivial, relevant example, give the expectation, and references for the definition of the involved objects, if not standard. (I was somehow puzzled about the meaning of a "dual toric diagram" and "dual toric fan"... Please give definitions or links to their meanings.)
Of course, sage code that initializes sample data would be wonderful for potential helpers to get immediately in the matter.
If i understand the post, we want the following:
plot
it!)Here is some sample lines of code addressing these points, for more we need more (input).
import pprint
# (0) construct some vertices and the polyhedron determined by them
R = [ 0,
+3, +4, +5,
-3, -4, -5, ]
V = [ (s,t,u)
for (s,t,u) in cartesian_product( [R,R,R] )
if s^2 + t^2 + u^2 == 5^2 ]
P = Polyhedron( vertices = V )
L = P.lattice_polytope()
print "P has the following vertices:"
pprint.pprint( P.vertices_list() )
print "A plot of P..."
P.plot()
# (1) associate the fan of the polyhedron P
F = FaceFan( L )
# (2) plot the fan
print "The fan of the lattice L is as follows..."
F.plot()
print "The rays of the fan F are as follows:"
print F.rays()
# (3) associate the toric variety of the fan
T = ToricVariety( F )
print "A plot of the associated toric variety T..."
T.plot()
# (4) dual fan (?)
# there is only a dual lattice, that i can associate to a given lattice.
# or we may pass from a cone to its dual cone,
# but this is an operation that may map
# disjoint (open) cones to intersecting dual cones.
# example
c = F.cones()[3][0] # first cone in the fan F
print "The rays of the first cone are:\n", c.rays()
plot(c)
cd = c.dual()
print "The rays of its dual cone are:\n", cd.rays()
plot(cd)
Methods of the constructed objects can be detected by using `dir`, dir
, e.g. `dir(F)`, dir(F)
, or
using in the sage console the TAB-extensions list. (For this, type `F.`, F.
, then hit the TAB (twice).)
(twice).)