File: cyclic.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 (52 lines) | stat: -rw-r--r-- 1,199 bytes parent folder | download | duplicates (4)
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
export { "cyclic" }

cyclic = method()
cyclic (ZZ,Ring) := (n,kk) -> (
    R := kk[vars(0..n-1)];
    toList apply(1..n-1, d-> sum(0..n-1, 
	    i -> product(d, k -> R_((i+k)%n))
	    )) | {product gens R - 1}
    )

beginDocumentation()

doc /// 
    Key
    	cyclic
	(cyclic,ZZ,Ring)
    Headline
    	an example of a square polynomial system
    Usage
    	cyclic(n,kk)
    Inputs
    	n:ZZ
	    	the number of variables
	kk:Ring
	    	the coefficient ring
    Outputs
    	:List
	    	of polynomials in the system
    Description
    	Text
	    {\bf Cyclic n-roots} is a popular benchmark problem. 
	    It has finitely many solutions iff n is square free. 
	    In this case the number of solutions is less than the Bezout bound.
	    
	    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 70 solutions found in 2.737 seconds with 5 variables.
	Example
	    cyclic(5,QQ)
    ///

-- test disabled, because it will fail on slightly slower machines

-- TEST ///
-- F = cyclic(5,CC_53)
-- assert(
--     first timing (sols = solveSystem F;) 
--     < 3
--     )
-- assert(#sols==70)
-- ///