load "calc_smn.m2";
load "mat2x3.m2";
-- Brian Pike, bpike@utsc.utoronto.ca, April 10, 2013
-- This file contains Macaulay2 code used to compute many examples of the reduced Euler characteristics of
-- singular Milnor fibers associated to sections of 2x3 matrix singularities.
-- See 'Solvable groups, free divisors and nonisolated matrix singularities II: vanishing topology'
-- by James Damon and Brian Pike
-- For the computation, we apply an element of \mathscr{K}_M to make the function transverse off 0 to
-- some additional varieties. We've stuck to multiplying our 2x3 matrix of functions (defining the map)
-- on the left and right by invertible integer matrices. Different matrices seem to be better for different maps,
-- depending on whether the resulting modules are homogeneous. A fairly effective way of finding these matrices
-- is to try (with timeLimit set) a number of randomly generated pairs of invertible matrices, and take whichever one
-- works best.
-- The examples are taken from
-- Fruhbis-Kruger, A. and Neumer, A. 'Simple Cohen-Macaulay Codimension 2 Singularities'. Comm. Algebra 38 no. 2 (2010) 454-495,
-- and we have numbered the examples in the order in which they appear.
infoDepth=0;
basisLimit=-1;
checkDimsWithSingular=false;
-- How many seconds to wait before one part of the computation times out, and the whole computation is ruined?
-- Put -1 for 'forever'
timeLimit=-1;
--------------------- BEGIN MAPS FROM C^4 -----------------------------
S=coefficientRing(R)[w,x,y,z,MonomialOrder=>RevLex,Global=>false];
if (checkDimsWithSingular) then (
-- Some preliminary Singular code to stderr.
stderr<<"ring S=32003,(w,x,y,z),ls;"<