File: katsura.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 (54 lines) | stat: -rw-r--r-- 1,235 bytes parent folder | download | duplicates (3)
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
export { "katsura" }

katsura = method()
katsura (ZZ,Ring) := (n,kk) -> (
     n = n-1;
     R := kk[vars(0..n)];
     L := gens R;
     u := i -> (
	  if i < 0 then i = -i;
	  if i <= n then L_i else 0_R
	  );
     f1 := -1 + sum for i from -n to n list u i;
     toList prepend(f1, apply(0..n-1, i -> 
	     - u i + sum(-n..n, j -> (u j) * (u (i-j)))
	     ))
     )

beginDocumentation()

doc /// 
    Key
    	katsura
    	(katsura,ZZ,Ring)
    Headline
    	an example of a 0-dimensional square polynomial system
    Usage
    	katsura(n,kk)
    Inputs
    	n:ZZ
	     the number of variables
        kk:Ring
	     the coefficient ring
    Outputs
    	:List
	    	of polynomials in the system
    Description
    	Text
	    This system was solved in May 2020, using @TO solveSystem@ in Macaulay2 v1.15
	     with an Intel(R) Core(TM) i5-5250U CPU at 1.60GHz.
	   
	    There were 512 solutions found in 2.804 seconds with 10 variables.
	    
	    The unknowns stand for the values (in [0,1])
	    of a distribution function of a field created by a mixture of 
	    a ferro-antiferro-magnetic bond at some points.
	Example
	    katsura(10,QQ)
    ///

-* TEST ///
F = katsura(10,QQ)
sols = solveSystem F
assert(#sols==512)
/// *-