Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 4183461[1X3 [33X[0;0YExamples[133X[101X234[1X3.1 [33X[0;0YGenerators[133X[101X56[4X[32X Example [32X[104X7[4X[25Xgap>[125X [27XC := NmzCone(["integral_closure",[[2,1],[1,3]]]);[127X[104X8[4X[28X<a Normaliz cone>[128X[104X9[4X[25Xgap>[125X [27XNmzHasConeProperty(C,"HilbertBasis");[127X[104X10[4X[28Xfalse[128X[104X11[4X[25Xgap>[125X [27XNmzHasConeProperty(C,"SupportHyperplanes");[127X[104X12[4X[28Xfalse[128X[104X13[4X[25Xgap>[125X [27XNmzConeProperty(C,"HilbertBasis");[127X[104X14[4X[28X[ [ 1, 1 ], [ 1, 2 ], [ 1, 3 ], [ 2, 1 ] ][128X[104X15[4X[25Xgap>[125X [27XNmzHasConeProperty(C,"SupportHyperplanes");[127X[104X16[4X[28Xtrue[128X[104X17[4X[25Xgap>[125X [27XNmzConeProperty(C,"SupportHyperplanes");[127X[104X18[4X[28X[ [ -1, 2 ], [ 3, -1 ] ][128X[104X19[4X[32X[104X202122[1X3.2 [33X[0;0YSystem of equations[133X[101X2324[4X[32X Example [32X[104X25[4X[25Xgap>[125X [27XD := NmzCone(["equations",[[1,2,-3]], "grading",[[0,-1,3]]]);[127X[104X26[4X[28X<a Normaliz cone>[128X[104X27[4X[25Xgap>[125X [27XNmzCompute(D,["DualMode","HilbertSeries"]);[127X[104X28[4X[28Xtrue[128X[104X29[4X[25Xgap>[125X [27XNmzHilbertBasis(D);[127X[104X30[4X[28X[ [ 1, 1, 1 ], [ 0, 3, 2 ], [ 3, 0, 1 ] ][128X[104X31[4X[25Xgap>[125X [27XNmzHilbertSeries(D);[127X[104X32[4X[28X[ t^2-t+1, [ [ 1, 1 ], [ 3, 1 ] ] ][128X[104X33[4X[25Xgap>[125X [27XNmzHasConeProperty(D,"SupportHyperplanes");[127X[104X34[4X[28Xtrue[128X[104X35[4X[25Xgap>[125X [27XNmzSupportHyperplanes(D);[127X[104X36[4X[28X[ [ 1, 0, 0 ], [ 1, 3, -3 ] ][128X[104X37[4X[25Xgap>[125X [27XNmzEquations(D);[127X[104X38[4X[28X[ [ 1, 2, -3 ] ][128X[104X39[4X[32X[104X404142[1X3.3 [33X[0;0YSystem of inhomogeneous equations[133X[101X4344[4X[32X Example [32X[104X45[4X[25Xgap>[125X [27XP := NmzCone(["inhom_equations",[[1,2,-3,1]], "grading", [[1,1,1]]]);[127X[104X46[4X[28X<a Normaliz cone>[128X[104X47[4X[25Xgap>[125X [27XNmzIsInhomogeneous(C);[127X[104X48[4X[28Xfalse[128X[104X49[4X[25Xgap>[125X [27XNmzIsInhomogeneous(P);[127X[104X50[4X[28Xtrue[128X[104X51[4X[25Xgap>[125X [27XNmzHilbertBasis(P);[127X[104X52[4X[28X[ [ 1, 1, 1, 0 ], [ 3, 0, 1, 0 ], [ 0, 3, 2, 0 ] ][128X[104X53[4X[25Xgap>[125X [27XNmzModuleGenerators(P);[127X[104X54[4X[28X[ [ 0, 1, 1, 1 ], [ 2, 0, 1, 1 ] ][128X[104X55[4X[32X[104X565758[1X3.4 [33X[0;0YCombined input[133X[101X5960[33X[0;0YNormaliz also allows the combination of different kinds of input, e.g.61multiple constraint types, or additional data like a grading.[133X6263[33X[0;0YSuppose that you have a 3 by 3 [21Xsquare[121X of nonnegative integers such that the643 numbers in all rows, all columns, and both diagonals sum to the same65constant [22XM[122X. Sometimes such squares are called magic and [22XM[122X is the magic66constant. This leads to a linear system of equations. The magic constant is67a natural choice for the grading. Additionally we force here the 4 corner to68have even value by adding congruences.[133X6970[4X[32X Example [32X[104X71[4X[25Xgap>[125X [27XMagic3x3even := NmzCone(["equations",[127X[104X72[4X[25X>[125X [27X[ [1, 1, 1, -1, -1, -1, 0, 0, 0],[127X[104X73[4X[25X>[125X [27X [1, 1, 1, 0, 0, 0, -1, -1, -1],[127X[104X74[4X[25X>[125X [27X [0, 1, 1, -1, 0, 0, -1, 0, 0],[127X[104X75[4X[25X>[125X [27X [1, 0, 1, 0, -1, 0, 0, -1, 0],[127X[104X76[4X[25X>[125X [27X [1, 1, 0, 0, 0, -1, 0, 0, -1],[127X[104X77[4X[25X>[125X [27X [0, 1, 1, 0, -1, 0, 0, 0, -1],[127X[104X78[4X[25X>[125X [27X [1, 1, 0, 0, -1, 0, -1, 0, 0] ],[127X[104X79[4X[25X>[125X [27X"congruences",[127X[104X80[4X[25X>[125X [27X[ [1, 0, 0, 0, 0, 0, 0, 0, 0, 2],[127X[104X81[4X[25X>[125X [27X [0, 0, 1, 0, 0, 0, 0, 0, 0, 2],[127X[104X82[4X[25X>[125X [27X [0, 0, 0, 0, 0, 0, 1, 0, 0, 2],[127X[104X83[4X[25X>[125X [27X [0, 0, 0, 0, 0, 0, 0, 0, 1, 2] ],[127X[104X84[4X[25X>[125X [27X"grading",[127X[104X85[4X[25X>[125X [27X[ [1, 1, 1, 0, 0, 0, 0, 0, 0] ] ] );[127X[104X86[4X[28X<a Normaliz cone>[128X[104X87[4X[25Xgap>[125X [27XNmzHilbertBasis(Magic3x3even);[127X[104X88[4X[28X[ [ 0, 4, 2, 4, 2, 0, 2, 0, 4 ], [ 2, 0, 4, 4, 2, 0, 0, 4, 2 ],[128X[104X89[4X[28X [ 2, 2, 2, 2, 2, 2, 2, 2, 2 ], [ 2, 4, 0, 0, 2, 4, 4, 0, 2 ],[128X[104X90[4X[28X [ 4, 0, 2, 0, 2, 4, 2, 4, 0 ], [ 2, 3, 4, 5, 3, 1, 2, 3, 4 ],[128X[104X91[4X[28X [ 2, 5, 2, 3, 3, 3, 4, 1, 4 ], [ 4, 1, 4, 3, 3, 3, 2, 5, 2 ],[128X[104X92[4X[28X [ 4, 3, 2, 1, 3, 5, 4, 3, 2 ] ][128X[104X93[4X[25Xgap>[125X [27XNmzHilbertSeries(Magic3x3even);[127X[104X94[4X[28X[ t^3+3*t^2-t+1, [ [ 1, 1 ], [ 2, 2 ] ] ][128X[104X95[4X[25Xgap>[125X [27XNmzHilbertQuasiPolynomial(Magic3x3even);[127X[104X96[4X[28X[ 1/2*t^2+t+1, 1/2*t^2-1/2 ][128X[104X97[4X[32X[104X9899100[1X3.5 [33X[0;0YUsing the dual mode[133X[101X101102[33X[0;0YFor solving systems of equations and inequalities it is often faster to use103the dual Normaliz algorithm. We demonstrate how to use it with an104inhomogeneous system of equations and inequalities.[133X105106[33X[0;0YThe input consists of a system of 8 inhomogeneous equations in R^3. The107first row of the matrix M encodes the inequality [22X8x + 8y + 8z + 7 ≥ 0[122X.108Additionally we say that [22Xx, y, z[122X should be non-negative by giving the sign109vector and use the total degree.[133X110111[4X[32X Example [32X[104X112[4X[25Xgap>[125X [27XM := [[127X[104X113[4X[25X>[125X [27X [ 8, 8, 8, 7 ],[127X[104X114[4X[25X>[125X [27X [ 0, 4, 0, 1 ],[127X[104X115[4X[25X>[125X [27X [ 0, 1, 0, 7 ],[127X[104X116[4X[25X>[125X [27X [ 0, -2, 0, 7 ],[127X[104X117[4X[25X>[125X [27X [ 0, -2, 0, 1 ],[127X[104X118[4X[25X>[125X [27X [ 8, 48, 8, 17 ],[127X[104X119[4X[25X>[125X [27X [ 1, 6, 1, 34 ],[127X[104X120[4X[25X>[125X [27X [ 2,-12, -2, 37 ],[127X[104X121[4X[25X>[125X [27X [ 4,-24, -4, 14 ][127X[104X122[4X[25X>[125X [27X];[127X[104X123[4X[28X[ [ 8, 8, 8, 7 ], [ 0, 4, 0, 1 ], [ 0, 1, 0, 7 ], [ 0, -2, 0, 7 ],[128X[104X124[4X[28X [ 0, -2, 0, 1 ], [ 8, 48, 8, 17 ], [ 1, 6, 1, 34 ],[128X[104X125[4X[28X [ 2, -12, -2, 37 ], [ 4, -24, -4, 14 ] ][128X[104X126[4X[25Xgap>[125X [27XD := NmzCone(["inhom_inequalities", M,[127X[104X127[4X[25X>[125X [27X "signs", [[1,1,1]],[127X[104X128[4X[25X>[125X [27X "grading", [[1,1,1]]]);[127X[104X129[4X[28X<a Normaliz cone>[128X[104X130[4X[25Xgap>[125X [27XNmzCompute(D,["DualMode","HilbertBasis","ModuleGenerators"]);[127X[104X131[4X[28Xtrue[128X[104X132[4X[25Xgap>[125X [27XNmzHilbertBasis(D);[127X[104X133[4X[28X[ [ 1, 0, 0, 0 ], [ 1, 0, 1, 0 ] ][128X[104X134[4X[25Xgap>[125X [27XNmzModuleGenerators(D);[127X[104X135[4X[28X[ [ 0, 0, 0, 1 ], [ 0, 0, 1, 1 ], [ 0, 0, 2, 1 ], [ 0, 0, 3, 1 ] ][128X[104X136[4X[32X[104X137138[33X[0;0YAs result we get the Hilbert basis of the cone of the solutions to the139homogeneous system and the module generators which are the base solutions to140the inhomogeneous system.[133X141142143144