ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 23 Apr 2020 16:30:25 -0500Can sage determine if a cone is gorenstein?http://ask.sagemath.org/question/34720/can-sage-determine-if-a-cone-is-gorenstein/Let M and N be dual lattices of rank d. A d-dimensional rational finite polyhedral cone C is called a *Gorenstein cone* if it is generated by finitely many lattice points which are contained in an affine hyperplane $\{x in M_RR : <x,n>=1\}$ for some n in N.
Does sage have the capibility to determine if a given cone is Gorenstein?Sun, 04 Sep 2016 17:36:58 -0500http://ask.sagemath.org/question/34720/can-sage-determine-if-a-cone-is-gorenstein/Comment by Jonathan Kliem for <p>Let M and N be dual lattices of rank d. A d-dimensional rational finite polyhedral cone C is called a <em>Gorenstein cone</em> if it is generated by finitely many lattice points which are contained in an affine hyperplane ${x in M_RR : <x,n>=1}$ for some n in N.</p>
<p>Does sage have the capibility to determine if a given cone is Gorenstein?</p>
http://ask.sagemath.org/question/34720/can-sage-determine-if-a-cone-is-gorenstein/?comment=50974#post-id-50974Normaliz might be useful here. It's an optional package of sage and if you have it installed you can use it:
sage: import PyNormaliz
sage: C = PyNormaliz.NmzCone("cone", [[0, 0, 1, -1], [0, 1, -1, 0], [1, -1, 0, 0]]) # homogenous input
sage: PyNormaliz.NmzResult(C, "IsGorenstein")
True
I'm not sure, whether or not the definition in normaliz agrees with your definition.Thu, 23 Apr 2020 16:30:25 -0500http://ask.sagemath.org/question/34720/can-sage-determine-if-a-cone-is-gorenstein/?comment=50974#post-id-50974Answer by Jonathan Kliem for <p>Let M and N be dual lattices of rank d. A d-dimensional rational finite polyhedral cone C is called a <em>Gorenstein cone</em> if it is generated by finitely many lattice points which are contained in an affine hyperplane ${x in M_RR : <x,n>=1}$ for some n in N.</p>
<p>Does sage have the capibility to determine if a given cone is Gorenstein?</p>
http://ask.sagemath.org/question/34720/can-sage-determine-if-a-cone-is-gorenstein/?answer=50969#post-id-50969Normaliz can do it, which is an optional package of sage. So I guess the following answer is only useful, if you have installed sage from source. (Technically, all you need is a normaliz and a way to transfer your input into normaliz input.)
Unfortunately, normaliz only accepts homogeneous format for this property and as of now (sage 9.1), we have to do some work :
sage: import PyNormaliz
sage: P = Polyhedron(rays=[[0, 0, 1, -1], [0, 1, -1, 0], [1/2, -1/2, 0, 0]], backend='normaliz', verbose=True)
# ----8<---- Equivalent Normaliz input file ----8<----
amb_space 4
cone 3
0 0 1 -1
0 1 -1 0
1 -1 0 0
subspace 0
vertices 1
0 0 0 0 1
# ----8<-------------------8<-------------------8<----
# Calling PyNormaliz.NmzCone(cone=[[0, 0, 1, -1], [0, 1, -1, 0], [1, -1, 0, 0]], subspace=[], vertices=[[0, 0, 0, 0, 1]])
sage: C = PyNormaliz.NmzCone("cone", [[0, 0, 1, -1, 0], [0, 1, -1, 0, 0], [1, -1, 0, 0, 0], [0, 0, 0, 0, 1]]) # homogenized input
sage: PyNormaliz.NmzResult(C, "IsGorenstein")
True
The verbose call of the polyhedron constructor is of course not necessary, but it is useful to figure out the normaliz input.
The homogenized input is obtained by appending a 0 to rays and a 1 to vertices and putting them together as input `cone`.Thu, 23 Apr 2020 14:43:23 -0500http://ask.sagemath.org/question/34720/can-sage-determine-if-a-cone-is-gorenstein/?answer=50969#post-id-50969