/
MultiplierIdeals.m2
2197 lines (1935 loc) · 71.1 KB
/
MultiplierIdeals.m2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-- -*- coding: utf-8 -*-
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- MULTIPLIER IDEALS -----------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Copyright 2011, 2012, 2013 Claudiu Raicu, Bart Snapp, Zach Teitler
--
-- This program is free software: you can redistribute it and/or modify it under
-- the terms of the GNU General Public License as published by the Free Software
-- Foundation, either version 3 of the License, or (at your option) any later
-- version.
--
-- This program is distributed in the hope that it will be useful, but WITHOUT
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-- details.
--
-- You should have received a copy of the GNU General Public License along with
-- this program. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------------
newPackage(
"MultiplierIdeals",
Version => "1.1",
Date => "April 14, 2015",
Authors => {
{
Name => "Zach Teitler",
Email => "zteitler@member.ams.org",
HomePage => "http://math.boisestate.edu/~zteitler/"
},
{
Name => "Bart Snapp"
},
{
Name => "Claudiu Raicu"
}
},
Headline => "multiplier ideals, log canonical thresholds,
and jumping numbers",
PackageImports=>{
"ReesAlgebra",
"Normaliz"
},
PackageExports=>{
"HyperplaneArrangements"
},
DebuggingMode=>false
)
-- Main functionality:
-- Multiplier ideals.
-- Input: an ideal, a real number
-- Output: the multiplier ideal
-- When possible, use specialized routines for
-- monomial ideals (implemented in this package)
-- ideal of monomial curve (implemented in this package)
-- generic determinantal ideals (implemented in this package)
-- hyperplane arrangements (implemented in this package)
-- For arbitrary ideals, load and use the Dmodules package
-- (NOT loaded by this package)
-- Implementation for monomial ideals is based on Howald's Theorem,
-- arXiv:math/0003232v1 [math.AG]
-- J.A. Howald, "Multiplier ideals of monomial ideals.",
-- Trans. Amer. Math. Soc. 353 (2001), no. 7, 2665-2671
-- Implementation for monomial curves is based on the algorithm given in
-- H.M. Thompson's paper: "Multiplier Ideals of Monomial Space
-- Curves." Proc. Amer. Math. Soc. Ser. B 1 (2014), 33–41.
-- Implementation for generic determinantal ideals is based on the
-- dissertation of Amanda Johnson, U. Michigan, 2003
-- Implementation for hyperplane arrangements is based on
-- algorithm given in
-- Zach Teitler, "A note on Mustață's computation of multiplier ideals
-- of hyperplane arrangements.", Proc. Amer. Math. Soc. 136 (2008),
-- no. 5, 1575--1579
-- arXiv:math/0610303 [math.AG]
-- The implementation here is a borrowing and modification (with permission)
-- from the HyperplaneArrangements package by Graham Denham & Greg Smith.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- EXPORTS ---------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
export {
multiplierIdeal,
logCanonicalThreshold,
jumpingNumbers,
Interval,
IntervalType
}
-- exportMutable {}
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- PACKAGES --------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Format of command as of Normaliz 2.7:
setNmzOption("bigint",true);
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- METHODS ---------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Here are method functions whose implementations depend heavily on the
-- type of ideal whose multiplier ideal,lct, or jumping numbers are being
-- computed.
-- The methods are grouped by type of ideal: monomial, hyperplane, etc.
-- Exported:
multiplierIdeal = method();
logCanonicalThreshold = method();
jumpingNumbers = method(Dispatch => Thing,
Options => {
Interval => {0,infinity},
IntervalType => "Closed"
}
);
-- Private:
skodaPeriodicityOnset = method();
jumpingDenominators = method();
--------------------------------------------------------------------------------
-- SHARED ROUTINES -------------------------------------------------------------
--------------------------------------------------------------------------------
intmat2monomIdeal = method();
intmat2monomIdeal ( Matrix, Ring ) := (M,R) -> (
if ( numColumns M > numgens R ) then (
error("intmat2monomIdeal: Not enough generators in ring.");
);
genList := apply( 0..< numRows M ,
i -> R_(flatten entries M^{i}) );
return monomialIdeal genList;
);
-- only include rows whose last entry is d; and ignore last column
intmat2monomIdeal ( Matrix, Ring, ZZ ) := (M,R,d) ->
intmat2monomIdeal(M,R,d,numColumns(M)-1);
-- only include rows with entry 'd' in column 'c'; and ignore column 'c'
intmat2monomIdeal ( Matrix, Ring, ZZ, ZZ ) := (M,R,d,c) -> (
if ( numColumns M > 1 + numgens R ) then (
error("intmat2monomIdeal: Not enough generators in ring.");
);
rowList := select( 0 ..< numRows M , i -> (M_(i,c) == d) ) ;
columnList := delete( c , toList(0 ..< numColumns M) );
M1 := submatrix(M,rowList,columnList);
return intmat2monomIdeal(M1,R);
);
-- skodaPeriodicityOnset
-- a value sufficiently large that Skoda periodicity has begun:
-- J(I^t) = I.J(I^(t-1)) for t > skodaPeriodicityOnset
-- skodaPeriodicityOnset = min(ambient dimension, numgens I, analyticSpread I)
-- = analyticSpread I
-- for some of the classes of ideals below, we may use a simpler version
-- of the bound than analytic spread
skodaPeriodicityOnset (Ideal) := (I) -> (
if ( I.cache#?"skodaPeriodicityOnset" ) then (
I.cache#"skodaPeriodicityOnset"
) else (
I.cache#"skodaPeriodicityOnset" = analyticSpread(I);
I.cache#"skodaPeriodicityOnset"
)
)
-- Qinterval
-- give all rational numbers k/denom in the interval [a, b]
-- for one or a list of denominators
Qinterval = method(Options=>{IntervalType=>"Closed"});
Qinterval ( ZZ , Number , Number ) := o -> ( denom, a, b ) -> (
ql := apply(ceiling(denom*a) .. floor(denom*b) , k -> promote(k/denom,QQ));
if ( o.IntervalType == "Closed" ) then (
return ql;
) else if ( o.IntervalType == "Open" ) then (
return select(ql, x -> a<x and x<b);
) else if ( o.IntervalType == "ClosedOpen" ) then (
return select(ql, x -> x<b);
) else if ( o.IntervalType == "OpenClosed" ) then (
return select(ql, x -> a<x);
);
)
Qinterval ( List , Number , Number ) := o -> ( denoms , a , b ) -> (
-- empty interval?
if ( a > b ) then (
return { };
);
qSet := set {};
for d in denoms do (
qSet = qSet + set Qinterval( d , a , b , o );
);
return sort toList qSet;
)
Qinterval ( ZZ , Number , InfiniteNumber ) := o -> (d,a,b) ->
Qinterval(d,a,a,o);
Qinterval ( ZZ , InfiniteNumber , Number ) := o -> (d,a,b) -> {};
Qinterval ( ZZ , InfiniteNumber , InfiniteNumber ) := o -> (d,a,b) -> {};
Qinterval ( List , Number , InfiniteNumber ) := o -> (d,a,b) ->
Qinterval(d,a,a,o);
Qinterval ( List , InfiniteNumber , Number ) := o -> (d,a,b) -> {};
Qinterval ( List , InfiniteNumber , InfiniteNumber ) := o -> (d,a,b) -> {};
Qinterval ( ZZ , List ) := o -> (denom, interval) ->
Qinterval(denom, interval#0, interval#1, o)
Qinterval ( List , List ) := o -> (denoms, interval) ->
Qinterval(denoms, interval#0, interval#1, o)
jumpingNumbers Sequence := o -> args -> (
a := max(o.Interval#0, logCanonicalThreshold(args));
local b;
if ( o.Interval#1 == infinity ) then (
b = skodaPeriodicityOnset(args);
) else (
b = o.Interval#1;
);
-- potential jumping numbers
pjn := Qinterval(jumpingDenominators(args),a,b,IntervalType=>o.IntervalType);
if ( #pjn == 0 ) then (
return { { }, { } }; -- no jumping numbers, no multiplier ideals
);
local prev;
local next;
local jumpingNumbers;
local multiplierIdeals;
mylct := logCanonicalThreshold(args);
-- Figure out whether pjn#0 is a jumping number:
-- We know pjn#0 >= mylct.
-- If pjn#0 == mylct, then it's definitely a jumping number
-- Otherwise, need to actually check:
-- we want to compare J(I^p) and J(I^(p-epsilon)) (where p=pjn#0)
-- We don't know how small epsilon needs to be,
-- so find the greatest potential jumping number less than p
-- and use that for p-epsilon
if ( (pjn#0) == mylct ) then (
jumpingNumbers = { mylct };
prev = trim multiplierIdeal append(args,mylct);
next = prev;
multiplierIdeals = { prev };
) else (
pjn2 := Qinterval(jumpingDenominators(args), logCanonicalThreshold(args),
pjn#0 );
-- pjn2#-1 = pjn#0
-- The greatest potential jumping number less than p is pjn2#-2
prev = trim multiplierIdeal append(args,pjn2#-2);
next = trim multiplierIdeal append(args,pjn#0);
if ( prev != next ) then (
-- yes it is a jumping number
jumpingNumbers = { pjn#0 };
multiplierIdeals = { next };
) else (
-- no it is not a jumping number
jumpingNumbers = { };
multiplierIdeals = { };
);
);
-- Now check whether rest of pjn's are jumping numbers:
for i from 1 to (#pjn-1) do (
prev = next;
next = trim multiplierIdeal append(args,pjn#i);
if ( prev != next ) then (
jumpingNumbers = append( jumpingNumbers , pjn#i );
multiplierIdeals = append( multiplierIdeals , next );
);
);
return {jumpingNumbers, multiplierIdeals};
)
jumpingNumbers MonomialIdeal := o -> I -> jumpingNumbers(sequence I, o)
jumpingNumbers CentralArrangement := o -> A -> jumpingNumbers(sequence A, o)
--------------------------------------------------------------------------------
-- VIA DMODULES ----------------------------------------------------------------
--------------------------------------------------------------------------------
{*
Unfortunately it is extremely difficult to acheive
compatibility with both Dmodules and HyperplaneArrangements,
due primarily to conflicts in definitions of the method
lct (defined in both Dmodules and HyperplaneArrangements)
and the methods multiplierIdeal (Dmodules) and multIdeal
(HyperplaneArrangements).
At this point we are forced to separate our package from
either Dmodules or HyperplaneArrangements. We choose to
remain connected to HyperplaneArrangements for the following
reasons: Dmodules has a complete treatment of multiplier ideals
(including jumping numbers); we have little or nothing to add.
HyperplaneArrangements, on the other hand, is missing a
treatment of jumping numbers, which our package can supply.
In addition, the situation of HyperplaneArrangements is in
keeping with the current emphasis of this package,
namely, computation of multiplier ideals for various particular
classes of ideals, using nongeneral routines.
(Note this is the current emphasis, not necessarily the long-term
goal of this package.)
*}
--------------------------------------------------------------------------------
-- MONOMIAL IDEALS -------------------------------------------------------------
--------------------------------------------------------------------------------
{*
Code in this section written by Zach Teitler 2010, 2011, 2012
*}
-- NewtonPolyhedron
-- compute a matrix A such that Ax >= 0 defines the cone over
-- the Newton polyhedron of a monomial ideal
-- (ie Newt(I) is placed at height 1)
-- Uses Normaliz
NewtonPolyhedron = method();
NewtonPolyhedron (MonomialIdeal) := I -> (
R := ring I;
-- use R;
nmzFilename = temporaryFileName() ;
setNmzOption("supp",true);
-- Compute equations of supporting hyperplanes of (cone over) Newt(I)
normaliz( matrix(I / exponents / flatten) , 3 );
M := readNmzData("sup");
-- Clean up tmp files, options
setNmzOption("supp",false);
rmNmzFiles();
return M;
);
-- multiplierIdeal of monomialIdeal
-- input: monomialIdeal I, rational number t
-- output: multiplier ideal J(I^t)
----
---- How it works:
----
---- First, compute integer matrix M defining Newton polyhedron Newt(I)
---- in the sense that M = (A|-b) where x^v \in I iff M(v|1) >= 0,
---- ie, Av >= b.
---- Some rows are ``unit rows'' with a single nonzero entry which is a 1,
---- corresponding to requiring the exponents (entries of v) to be >= 0.
---- These define *coordinate* facets of Newt(I) (ie, facets of Newt(I)
---- contained in facets of the positive orthant). All other rows define
---- *non-coordinate* facets.
----
---- Second, get an integer matrix for t*Newt(I) by writing t=p/q
---- and setting M1 = (pA | -qb).
----
---- The inequality
---- (pA) * v >= (qb),
---- or
---- M1 * ( v | 1 ) >= 0,
---- corresponds to t*Newt(I). From Howald's Theorem, we need the interior,
---- Int(t*Newt(I)). It is not quite correct to take M1 * (v | 1) > 0,
---- because this is wrong for the coordinate faces. (It is correct for the
---- non-coordinate faces.) Here "interior" means: relative to the positive
---- orthant. In other words, we are removing the part of the boundary of
---- t*Newt(I) which is in the interior of the positive orthant.
----
---- Let 'bump' be a vector of the same length as b, with entries 0 or 1:
---- the entry is 0 in each row of M1 corresponding to a coordinate face,
---- the entry is 1 in each row of M1 corresponding to a non-coordinate face.
---- Then the lattice points in Int(t*Newt(I)) satisfy
---- (pA | -qb-bump) * (v | 1 ) >= 0,
---- that is
---- (pA)*v >= qb+bump.
---- For integer points with nonnegative entries this is equivalent to
---- (pA)*v > qb.
----
---- Finally, we use Normaliz to compute the monomial ideal containing x^v
---- for v in Int(t*Newt(I)); then use Macaulay2 to quotient by the product
---- of the variables, corresponding to Howald's (1,...,1).
multiplierIdeal (MonomialIdeal, ZZ) := (I,t) -> multiplierIdeal(I,promote(t,QQ))
multiplierIdeal (MonomialIdeal, QQ) := (I,t) -> (
R := ring I;
-- use R;
local multIdeal;
if ( t <= 0 ) then (
multIdeal = monomialIdeal(1_R) ;
) else if ( I == ideal(0_R) ) then (
multIdeal = monomialIdeal(0_R);
) else if ( I == ideal(1_R) ) then (
multIdeal = monomialIdeal(1_R);
) else if ( t >= skodaPeriodicityOnset I ) then (
s := 1 + floor(t-skodaPeriodicityOnset(I));
multIdeal = I^s*multiplierIdeal(I,t-s) ;
) else (
M := NewtonPolyhedron(I);
m := numRows M;
n := numColumns M;
-- ambient dimension = n-1 !!
nmzFilename = temporaryFileName() ;
setNmzOption("normal",true);
-- Scale to get t*Newt(I) (clear denominators)
p := numerator t;
q := denominator t;
M1 := M * diagonalMatrix( flatten { toList((n-1):q) , {p} } );
-- Set up "bump" of nontrivial facets, but don't bump coordinate facets
-- (except we do end up bumping the row (0,..,0,1); but that's okay,
-- no harm)
bump := apply(toList(0..<m) ,
i -> ( if ( M_(i,n-1) >= 0 ) then ( return 0; ) else ( return 1; ) ) );
-- now bump has a 0 in rows corresponding to coordinate facets, 1 in other
-- rows
-- "Bump" t*Newt(I): push nontrivial facets in by "epsilon" (which is 1)
M2 := M1 - ( matrix(toList(m:toList((n-1):0))) | transpose matrix({bump}) );
-- Semigroup of lattice points inside "bumped" region (i.e., interior of
-- t*Newt(I))
nmzOut := normaliz(M2,4,grading=>toList(numColumns(M2):1));
M3 := nmzOut#"gen";
-- Ideal generated by those lattice points
J := intmat2monomIdeal(M3,R,1);
-- Howald's translation by (1,1,...,1) is same as colon with product of
-- variables
multIdeal = monomialIdeal quotient(J, product(flatten entries vars R)) ;
-- Clean up tmp files, options
setNmzOption("normal",false);
rmNmzFiles();
);
return trim multIdeal;
);
-- logCanonicalThreshold ( MonomialIdeal , RingElement )
-- threshold of inclusion in a multiplier ideal
-- input:
-- 1. a monomial ideal I
-- 2. a monomial x^v, or exponent vector v
-- output: a pair
-- 1. a rational number t, defined by
-- t = sup { c : x^v is in the c'th multiplier ideal of I }
-- the threshold (of inclusion of x^v in the multiplier ideal of I).
-- 2. a matrix (A' | -b') consisting of those rows of the defining matrix of
-- Newt(I) which impose the threshold on x^v.
-- In other words, the line joining the origin to the vector (v+(1,..,1)) hits
-- the boundary of Newt(I) at (1/t)*(v+(1,..,1)), and the vector
-- (1/t)*(v+(1,..,1)) lies on the facets defined by the rows of (A' | -b')
-- (via: (A'|-b')(w|1)^transpose >= 0 )
logCanonicalThreshold (MonomialIdeal , RingElement) := (I , mon) -> (
if ( leadMonomial(mon) != mon ) then (
error("Second input must be a monomial (input was ",mon,")");
);
R := ring I;
emptyMatrix := (matrix {{}})^{}; -- 0-by-0 matrix
if ( I == ideal(0_R) ) then (
return ( 0 , emptyMatrix );
) else if ( I == ideal(1_R) ) then (
return ( infinity , emptyMatrix );
);
v := first exponents mon;
M := NewtonPolyhedron(I);
m := numRows M;
n := numColumns M;
local i;
threshVal := infinity;
facetList := {}; -- list of rows
for i from 0 to m-1 do (
s := sum( toList(0..(n-2)) , j -> M_(i,j)*(1+v_j) );
if ( M_(i,n-1) != 0 and s != 0 ) then (
t := -1*s / M_(i,n-1) ;
if ( t < threshVal ) then (
threshVal = t;
facetList = {i};
) else if ( t == threshVal ) then (
facetList = append(facetList , i);
);
);
);
facetMatrix := M^facetList;
return ( threshVal , facetMatrix );
);
logCanonicalThreshold (MonomialIdeal) := I ->
first logCanonicalThreshold ( I , 1_(ring(I)) )
skodaPeriodicityOnset (MonomialIdeal) := I -> (
if I.cache#?"skodaPeriodicityOnset" then (
I.cache#"skodaPeriodicityOnset"
) else (
R := ring I;
if ( I == monomialIdeal(0_R) or I == monomialIdeal(1_R) ) then (
I.cache#"skodaPeriodicityOnset" = 0;
) else (
I.cache#"skodaPeriodicityOnset" = analyticSpread I;
);
I.cache#"skodaPeriodicityOnset"
)
)
jumpingDenominators (MonomialIdeal) := I -> (
R := ring I;
if ( I == monomialIdeal(0_R) or I == monomialIdeal(1_R) ) then (
return {1};
);
denomList := {};
M := NewtonPolyhedron(I);
m := numRows M;
n := numColumns M;
for i from 0 to m-1 do (
s := sum drop(flatten entries M^{i}, -1);
if ( M_(i,n-1) != 0 and s != 0 ) then (
denomList = append(denomList , -M_(i,n-1));
);
);
return denomList;
)
--------------------------------------------------------------------------------
-- MONOMIAL CURVES -------------------------------------------------------------
--------------------------------------------------------------------------------
{*
Code in this section written by Claudiu Raicu, Bart Snapp,
Zach Teitler 2011, 2012
*}
-- affineMonomialCurveIdeal
--
-- Compute defining ideal of a curve in affine 3-space parametrized by
-- monomials, i.e., parametrized by t -> (t^a,t^b,t^c) for positive integers
-- a,b,c.
--
-- Input:
-- * ring S
-- * list of integers {a,b,c}
-- Output:
-- * ideal (ideal in S defining curve parametrized by t->(t^a,t^b,t^c))
--
-- The ring S should be a polynomial ring over a field. Currently this
-- is not checked. The integers {a,b,c} should be positive. Currently
-- this is not checked. The output ideal may need to be trimmed, we
-- do not do this.
--
-- The code for affineMonomialCurveIdeal is based on the code for
-- monomialCurveideal from Macaulay2.
affineMonomialCurveIdeal = (S, a) -> (
-- check that S is a polynomial ring over a field
n := # a;
if not all(a, i -> instance(i,ZZ) and i >= 1)
then error "expected positive integers";
t := symbol t;
k := coefficientRing S;
M1 := monoid [t];
M2 := monoid [Variables=>n];
R1 := k M1;
R2 := k M2;
t = R1_0;
mm := matrix table(1, n, (j,i) -> t^(a#i));
j := generators kernel map(R1, R2, mm);
ideal substitute(j, submatrix(vars S, {0..n-1}))
)
-- ord
--
-- Compute monomial valuation of a given polynomial with respect to a
-- vector that gives the values of the variables.
--
-- Input:
-- * list mm = {a1,a2,a3,...}
-- * polynomial p
-- Output:
-- * integer
--
-- This computes the monomial valuation in which the variable x1 has
-- value a1, x2 has value a2,... The value of a polynomial is the
-- MINIMUM of the values of its terms (like order of vanishing, NOT
-- like degree).
--
-- The values {a1,a2,...} should be nonnegative and there should be at
-- least as many as the number of variables appearing in the
-- polynomial. Currently we do not check this.
ord = (mm,p) -> (
R := ring p;
degs := apply(listForm p, i-> first i);
min apply(degs, i -> sum apply(i,mm,times))
)
-- sortedGens
--
-- Compute the minimal generators of the defining ideal of the
-- monomial curve parametrized by t->(t^a1,t^a2,t^a3,...) and return
-- the list of generators in order of increasing values of
-- ord({a1,a2,a3,...}, -).
--
-- Input:
-- * ring R
-- * list nn = {a1,a2,a3,...} of integers
-- Output:
-- * list of polynomials
--
-- The ring R should be a polynomial ring over a field. Currently this
-- is not checked. The integers {a1,a2,a3,...} should be
-- positive. Currently this is not checked.
sortedGens = (R,nn) -> (
KK := coefficientRing R;
genList := flatten entries gens trim affineMonomialCurveIdeal(R,nn);
L := sort apply(genList, i -> {ord(nn,i), i});
apply(L, i-> last i)
)
-- exceptionalDivisorValuation
--
-- Compute the valuation induced by the (mm,ord(mm,f_2)) exceptional
-- divisor in the resolution of singularities of the monomial curve
-- with exponent vector nn.
--
-- Input:
-- * list of integers nn={a,b,c}
-- * list of integers mm={d,e,f}
-- * polynomial p (in 3 variables)
-- Output:
-- * integer
--
-- The valuation is defined as follows. First we computed the sorted
-- generators (f0,f1,f2,...) of the defining ideal of the
-- curve. Writing p = f0^d * g where g is not divisible by f0, the
-- valuation of p is d*ord(mm,f1) + ord(mm,g).
exceptionalDivisorValuation = (nn,mm,p) -> (
R := ring p;
ff := sortedGens(R,nn);
n := 0;
while p % ff_0 == 0 do (p = p//ff_0; n = n+1;);
n*ord(mm,ff_1) + ord(mm,p)
)
-- exceptionalDivisorDiscrepancy
--
-- Compute the multiplicity of the relative canonical divisor along
-- the (mm,ord(mm,f_2)-ord(mm,f_1)) exceptional divisor in the
-- resolution of singularities of a monomial curve.
--
-- Input:
-- * list of integers mm={a,b,c}
-- * sorted list of generators of the ideal of the monomial curve
-- Output:
-- * integer
exceptionalDivisorDiscrepancy = (mm,ff) -> (
sum(mm) - 1 + ord(mm, ff_1) - ord(mm, ff_0)
)
-- monomialValuationIdeal
--
-- Compute valuation ideal {h : ord(mm,h) >= val}.
--
-- Input:
-- * ring R
-- * list of integers mm={a1,a2,...}
-- * integer val
-- Output:
-- * ideal of R.
-- The ring R should be a polynomial ring over a field.
-- The list mm should have nonnegative integers, with at least as many as the
-- number of variables in R. Currently we do not check these things.
monomialValuationIdeal = (R,mm,val) -> (
M := (matrix{mm}|matrix{{-val}}) || id_(ZZ^(#mm+1));
setNmzOption("normal",true);
normalizOutput := normaliz(M,4,grading=>toList(numColumns(M):1));
M2 := normalizOutput#"gen";
setNmzOption("normal",false);
intmat2monomIdeal(M2,R,1)
)
-- exceptionalDivisorValuationIdeal
--
-- Compute valuation ideal {h : v(h) >= val}, where the valuation v is induced
-- by the (mm,ord(mm,f_2)-ord(mm,f_1)) exceptional divisor.
--
-- Input:
-- * ring R
-- * sorted list of generators of curve ideal
-- * list mm={a,b,c}
-- * integer val
-- Output:
-- * ideal
exceptionalDivisorValuationIdeal = (R,ff,mm,val) -> (
maxpow := ceiling(val / ord(mm,ff_1));
if maxpow < 0 then ideal(1_R) else
sum apply(splice{0..maxpow},
i -> ideal(ff_0^i)*monomialValuationIdeal(R,mm,val-i*ord(mm,ff_1)))
)
-- termIdeal
--
-- Compute smallest monomial ideal containing a given ideal.
--
-- Input:
-- * ideal
-- Output:
-- * monomialIdeal
termIdeal = I -> (
R := ring I;
if I == ideal 0_R then return monomialIdeal 0_R else
return monomialIdeal flatten apply(flatten entries gens I, i -> terms i)
)
-- symbolicPowerCurveIdeal
--
-- Compute symbolic power of the defining ideal of a monomial space curve.
--
-- Input:
-- * ideal I
-- * integer t
-- Output:
-- * ideal
--
-- For a prime ideal I and p>=0, the symbolic power I^(p) is the ideal of
-- functions vanishing to order at least p at every point of V(I).
-- It is the I-primary component of I^p. The non-I-primary
-- components of I^p have support contained in Sing(V(I)).
--
-- For our ideals (of monomial curves) the singular locus is a single point,
-- the origin. We compute the symbolic power by computing I^p, then saturating
-- with respect to the ideal of the origin (to remove unwanted primary
-- components).
--
-- In the future this may be replaced by a better algorithm, perhaps?
--
-- We assume the input ideal is indeed prime, and that its unique singular point
-- is the origin.
symbolicPowerCurveIdeal = (I,t) -> saturate(I^(max(0,t)))
-- intersectionIndexSet
--
-- Compute indexing set for intersection appearing in the formula for multiplier
-- ideals. This is a finite set of lattice points defined by some equations and
-- inequalities. See H.M. Thompson's paper (cited above).
--
-- Input:
-- * ring
-- * list of exponents
-- Output:
-- * list (of lattice points, each written as a list of integers)
--
-- Now, I'm commenting out a big block of code that was written by
-- Claudiu, Bart, and me in 2011, more or less directly translating
-- a preprint of H.M. Thompson.
-- First of all the code below has a bug (can't handle curves coming from
-- exponents {a,b,c} where c >= a*b ! didn't notice that until now...).
-- I know I should figure out what went wrong, but...
-- Second of all, H.M. Thompson has told me that in fact the situation
-- is much easier, at least for these monomial space curves anyway:
-- the intersection index set is simply the exponent vector
-- (the index set is a singleton)!
-- So, for now anyway, just return that.
-- Eventually we'll want to generalize beyond monomial curves,
-- at which point this will all get straightened out.
--
-- intersectionIndexSet = (ff) -> (
-- uu := {(exponents(ff_0))_0, (exponents(ff_1))_0};
-- vv := {(exponents(ff_0))_1, (exponents(ff_1))_1};
--
-- cols := #(uu_0);
-- candidateGens1 := (normaliz(matrix{uu_0 - vv_0} || matrix{vv_0 - uu_0} ||
-- matrix{uu_1 - vv_1} || id_(ZZ^cols),4))#"gen";
-- candidateGens2 := (normaliz(matrix{uu_0 - vv_0} || matrix{vv_0 - uu_0} ||
-- matrix{vv_1 - uu_1} || id_(ZZ^cols),4))#"gen";
-- candidateGens := candidateGens1 || candidateGens2;
-- rhoEquation := (transpose matrix {uu_1-uu_0}) |
-- (transpose matrix {vv_1-vv_0});
--
-- T := candidateGens * rhoEquation;
-- rows := toList select(0..<numRows T, i ->
-- all(0..<numColumns T, j -> T_(i,j) > 0));
-- unique apply(rows, i -> flatten entries candidateGens^{i})
-- )
intersectionIndexSet = (R,exps) -> {exps}
-- multiplierIdeal of MonomialCurve
--
-- Compute multiplier ideal of the defining ideal of a monomial space curve,
-- ie., a curve in affine 3-space parametrized by monomials, t->(t^a,t^b,t^c).
--
-- Input:
-- * ring R
-- * list of integers {a,b,c}, the exponents in the parametrization
-- * an integer or rational number t
-- Output:
-- * an ideal
multiplierIdeal (Ring, List, ZZ) := (R, nn, t) ->
multiplierIdeal(R,nn,promote(t,QQ))
multiplierIdeal (Ring, List, QQ) := (R, nn, t) -> (
ff := sortedGens(R,nn);
curveIdeal := affineMonomialCurveIdeal(R,nn);
indexList := intersectionIndexSet(R,nn);
symbpow := symbolicPowerCurveIdeal(curveIdeal , floor(t-1));
term := multiplierIdeal(termIdeal(curveIdeal) , t);
validl := intersect apply(indexList ,
mm -> exceptionalDivisorValuationIdeal(R,ff,mm,
floor(t*ord(mm,ff_1)-exceptionalDivisorDiscrepancy(mm,ff)) ));
trim intersect(symbpow,term,validl)
)
-- logCanonicalThreshold of MonomialCurve
--
-- Compute log canonical threshold of the defining ideal of a monomial
-- space curve, ie., a curve in affine 3-space parametrized by
-- monomials, t->(t^a,t^b,t^c).
--
-- Input:
-- * ring R
-- * list of integers {a,b,c}, the exponents in the parametrization
-- Output:
-- * a rational number
logCanonicalThreshold(Ring,List) := (R,nn) -> (
ff := sortedGens(R,nn);
indexList := intersectionIndexSet(R,nn);
curveIdeal := ideal ff;
lctTerm := logCanonicalThreshold(termIdeal(curveIdeal));
min (2, lctTerm,
min(
apply(indexList, mm ->
(exceptionalDivisorDiscrepancy(mm,ff)+1)/ord(mm,ff_1) )
) )
)
skodaPeriodicityOnset (Ring,List) := (R,exps) ->
analyticSpread affineMonomialCurveIdeal(R,exps)
jumpingDenominators (Ring,List) := (R,exps) -> (
ff := sortedGens(R,exps);
indexList := intersectionIndexSet(R,exps);
curveIdeal := ideal ff;
sort unique({1} | apply(indexList, m -> ord(m,ff_1)) |
jumpingDenominators(termIdeal(curveIdeal)))
)
--------------------------------------------------------------------------------
-- HYPERPLANE ARRANGEMENTS -----------------------------------------------------
--------------------------------------------------------------------------------
-- Based on code written by Graham Denham and Greg Smith for
-- their HyperplaneArrangements package
simpleCacheKey := getSymbol "simple";
multiplicitiesCacheKey := getSymbol "m";
irredCacheKey := getSymbol "irreds";
-- rank (Flat) := ZZ => F -> rank subArrangement F
weight := (F,m) -> sum((tolist F)/(i->m_i))
normal := h -> (
h/leadCoefficient h); -- representative of functional, mod scalars
-- trim defined in HyperplaneArrangements has this problem:
-- its results are put into the cache, in *unusable* keys :-(
-- A.cache.simple, A.cache.m -- but "simple" and "m" are protected,
-- unexported symbols.
-- As soon as they fix their package then this "betterTrim"
-- should be deleted from here, and we just use their trim
betterTrim := A -> (
if A.cache#?simpleCacheKey then return(A.cache#simpleCacheKey);
if (tolist A == {}) then (
A.cache#simpleCacheKey = A;
A.cache#multiplicitiesCacheKey = {};
return A;
) else (
count := new MutableHashTable;
scan(tolist A, h -> (
if h != 0 then (
if not count#?(normal h) then count#(normal h) = 0;
count#(normal h) = 1+count#(normal h);
)
));
(L,m) := (keys(count),values(count));
A' := arrangement(L, ring A);
A.cache#multiplicitiesCacheKey = m;
A.cache#simpleCacheKey = A';
return A';
);
);
irreducibles := A -> (
if not A.cache#?irredCacheKey then
A.cache#irredCacheKey = select(flatten drop(flats(A),1), F->(0 != euler F));
return A.cache#irredCacheKey;
);
multiplierIdeal (CentralArrangement,List,Number) := Ideal => (A,m,s) -> (
if (#tolist A != #m) then error "expected one weight for each hyperplane";
R := ring A;
if ( betterTrim(A) == arrangement({},R)
or betterTrim(A) == arrangement({0_R},R) ) then (
if ( s <= 0 ) then (
return ideal(1_R);
) else (
return ideal(0_R);
);
) else if ( betterTrim(A) == arrangement({1_R},R) ) then (
return ideal(1_R);
);
irreds := irreducibles(A);
exps := irreds/(F->max(0,floor(s*weight(F,m))-rank(F)+1));
ideals := irreds/(F-> trim ideal tolist (A_F));
return intersect apply(#exps, i->(ideals_i)^(exps_i));
);