// Setting up the Polynomial ring and ideal R := PolynomialRing(RationalField(), 8); MyIdeal := ideal; print "==TRIANGULATION" cat "=BEGINS=="; print "% Triangulation\nv1751\ngeometric_solution 5.44367619\noriented_manifold\nCS_unknown\n\n1 0\n torus 0.000000000000 0.000000000000\n\n7\n 1 1 2 3 \n 0132 2310 0132 0132\n 0 0 0 0 \n 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n 0 1 1 -2 0 0 0 0 0 0 0 0 -1 1 0 0\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n 0.370840115001 0.616169705448\n\n 0 3 2 0 \n 0132 3012 3012 3201\n 0 0 0 0 \n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n 0 1 0 -1 0 0 0 0 1 0 0 -1 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n 0.174878595875 1.060198097540\n\n 4 1 3 0 \n 0132 1230 2031 0132\n 0 0 0 0 \n 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n 0 0 1 -1 -1 0 1 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n 0.429523452409 0.710886164351\n\n 1 4 0 2 \n 1230 3201 0132 1302\n 0 0 0 0 \n 0 -1 1 0 0 0 0 0 0 1 0 -1 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n 0 -1 2 -1 0 0 0 0 0 1 0 -1 -1 1 0 0\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n 0.429523452409 0.710886164351\n\n 2 5 3 5 \n 0132 0132 2310 1023\n 0 0 0 0 \n 0 0 -1 1 0 0 0 0 0 0 0 0 0 -1 1 0\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n 0 0 -1 1 1 0 -1 0 0 0 0 0 0 -1 1 0\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n 0.802492079308 1.931535368910\n\n 6 4 6 4 \n 0132 0132 1023 1023\n 0 0 0 0 \n 0 0 0 0 0 0 1 -1 -1 1 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 1 -1 -1 1 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n 0.529979101585 0.209429284451\n\n 5 6 5 6 \n 0132 1302 1023 2031\n 0 0 0 0 \n 0 0 -1 1 0 0 0 0 0 -1 0 1 1 -1 0 0\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n 0 0 -1 1 0 0 0 0 0 -1 0 1 1 -1 0 0\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n 0.583183385688 0.051148530250\n\n"; print "==TRIANGULATION" cat "=ENDS=="; print "PY=EVAL=SECTION" cat "=BEGINS=HERE"; print "{'variable_dict' : (lambda d, negation = (lambda x:-x): { 's_3_1' : negation(d['1']), 's_3_0' : negation(d['1']), 's_3_3' : d['1'], 's_3_2' : d['1'], 's_3_5' : d['1'], 's_3_4' : d['1'], 's_2_0' : d['1'], 's_2_1' : d['1'], 's_2_2' : d['1'], 's_2_3' : negation(d['1']), 's_2_4' : d['1'], 's_2_5' : d['1'], 's_2_6' : d['1'], 's_1_6' : d['1'], 's_1_5' : d['1'], 's_1_4' : d['1'], 's_1_3' : d['1'], 's_1_2' : d['1'], 's_1_1' : negation(d['1']), 's_1_0' : negation(d['1']), 's_0_6' : d['1'], 's_0_4' : d['1'], 's_0_5' : d['1'], 's_0_2' : d['1'], 's_0_3' : negation(d['1']), 's_0_0' : d['1'], 's_0_1' : d['1'], 'c_1100_6' : d['c_0011_2'], 'c_1100_5' : negation(d['c_0011_2']), 'c_1100_4' : d['c_0011_2'], 's_3_6' : d['1'], 'c_1100_1' : negation(d['c_0011_0']), 'c_1100_0' : d['c_0101_2'], 'c_1100_3' : d['c_0101_2'], 'c_1100_2' : d['c_0101_2'], 'c_0101_6' : d['c_0101_6'], 'c_0101_5' : d['c_0101_5'], 'c_0101_4' : d['c_0101_0'], 'c_0101_3' : d['c_0101_1'], 'c_0101_2' : d['c_0101_2'], 'c_0101_1' : d['c_0101_1'], 'c_0101_0' : d['c_0101_0'], 'c_0011_5' : d['c_0011_2'], 'c_0011_4' : negation(d['c_0011_2']), 'c_0011_6' : negation(d['c_0011_2']), 'c_0011_1' : negation(d['c_0011_0']), 'c_0011_0' : d['c_0011_0'], 'c_0011_3' : d['c_0011_2'], 'c_0011_2' : d['c_0011_2'], 'c_1001_5' : d['c_0101_6'], 'c_1001_4' : d['c_0101_2'], 'c_1001_6' : d['c_0101_5'], 'c_1001_1' : negation(d['c_0011_2']), 'c_1001_0' : d['c_0101_1'], 'c_1001_3' : negation(d['c_0101_0']), 'c_1001_2' : d['c_0011_0'], 'c_0110_1' : d['c_0101_0'], 'c_0110_0' : d['c_0101_1'], 'c_0110_3' : negation(d['c_0011_0']), 'c_0110_2' : d['c_0101_0'], 'c_0110_5' : d['c_0101_6'], 'c_0110_4' : d['c_0101_2'], 'c_0110_6' : d['c_0101_5'], 'c_1010_6' : negation(d['c_0011_2']), 'c_1010_5' : d['c_0101_2'], 'c_1010_4' : d['c_0101_6'], 'c_1010_3' : negation(d['c_0101_2']), 'c_1010_2' : d['c_0101_1'], 'c_1010_1' : negation(d['c_0101_1']), 'c_1010_0' : negation(d['c_0101_0'])})}"; print "PY=EVAL=SECTION=ENDS=HERE"; // Initialize Q to -1 so that we can check whether an error happend // by checking that Q is still of type integer. Q := -1; // Remember start time to calculate computation time primTime := Cputime(); print "DECOMPOSITION=TYPE: Primary Decomposition of Radical"; P, Q := PrimaryDecomposition(Radical(MyIdeal)); print "IDEAL=DECOMPOSITION" cat "=TIME: ", Cputime(primTime); if Type(Q) eq RngIntElt then // Some error occured print "IDEAL=DECOMPOSITION" cat "=FAILED"; exit; else // Success print "IDEAL=DECOMPOSITION" cat "=BEGINS=HERE"; Q; print "IDEAL=DECOMPOSITION" cat "=ENDS=HERE"; print "FREE=VARIABLES=IN=COMPONENTS" cat "=BEGINS=HERE"; N := Names(R); isFirstComp := true; freeVarStr := "["; for Comp in Q do if isFirstComp then isFirstComp := false; else freeVarStr := freeVarStr cat ","; end if; freeVarStr := freeVarStr cat "\n [ "; D, Vars := Dimension(Comp); isFirstVar := true; for Var in Vars do if isFirstVar then isFirstVar := false; else freeVarStr := freeVarStr cat ", "; end if; freeVarStr := freeVarStr cat "\"" cat N[Var] cat "\""; end for; freeVarStr := freeVarStr cat " ]"; end for; freeVarStr := freeVarStr cat "\n]"; print freeVarStr; print "FREE=VARIABLES=IN=COMPONENTS" cat "=ENDS=HERE"; end if; print "CPUTIME: ", Cputime(primTime);