File: Ddual.m2

package info (click to toggle)
macaulay2 1.21%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 133,096 kB
  • sloc: cpp: 110,377; ansic: 16,306; javascript: 4,193; makefile: 3,821; sh: 3,580; lisp: 764; yacc: 590; xml: 177; python: 140; perl: 114; lex: 65; awk: 3
file content (50 lines) | stat: -rw-r--r-- 1,616 bytes parent folder | download
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
-- Copyright 1999-2002 by Anton Leykin and Harrison Tsai

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- These routines compute the dual of a holonomic D-module M, which is
-- the transposition of the right module Ext^n_D(M,D)
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Ddual = method()
Ddual Ideal := I -> (
     Ddual ((ring I)^1/I)
     )

Ddual Module := M -> (
     pInfo(1, "ENTERING Ddual ... ");
     W := ring M;
     if W.monoid.Options.WeylAlgebra === {} then
     error "expected an element of a Weyl algebra";
     pInfo (1, "Ddual: holonomicity check ...");
     if not isHolonomic M then
     error "expected a holonomic module";
     createDpairs W;
     n := #W.dpairVars#0; 
     outputList := {};
     
     C := Dres(M, LengthLimit => n+1);
     m0 := transpose Dtransposition C.dd#n;
     m1 := transpose Dtransposition C.dd#(n+1);  
     
     F0 := map(C#n, C#(n-1), m0);
     F1 := map(C#(n+1), C#n, m1);
     
     pres := presentation homology(F1,F0);
     dualM := cokernel zeroize Dprune pres;

     dualM
     )

TEST ///
-- dual of an Appell F1
I = AppellF1({2,-3,-2,5});
assert(ideal relations Ddual I == 
     substitute(AppellF1({-1,4,2,-3}), vars ring I));

-- dual of gkz associated to quadratic equation
A = matrix{{1,1,1},{0,1,2}};
b = {8/3,9/17};
I = gkz(A,b);
assert(ideal relations Ddual I == substitute(gkz(A,-b-{1,1}), vars ring I));
///