-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartHere.m2
78 lines (61 loc) · 2.42 KB
/
startHere.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
-- SCRIPT TO EXPLORE THE RESULTS and EXPLAIN BASIC FUNCTIONALITY
-- Best load this script, the 'lib/exploreResults.m2" and
-- the result files from 'results/...' you are interested in into
-- https://www.unimelb-macaulay2.cloud.edu.au/#editor
-- There, printing graphs will display their tikZ picture which is
-- very nice for exploration. Note that this script does assume
-- that all files in current folder, no results/ or lib/ (thats the case
-- in the online version)
load "exploreResults.m2"
-- loading data
fileNames := {
"3nodes_dags_{{1}, {2}, {3}}",
"3nodes_digraphs_{{1}, {2}, {3}}",
"4nodes_dags_{{1, 2}, {3}, {4}}",
"4nodes_digraphs_{{1}, {2}, {3}, {4}}"
}
fileName := fileNames_0;
(env,ptts,allGroups,graphs,allIdeals) = loadResults(fileName);
ptt = ptts_0;
groups = allGroups_0;
-------------------------
-- exploration functions
-------------------------
-- print the group distribution
printGroupCounts(groups);
-- show 2 randomly selected cov.equivalence groups with 3 members
showNGroupsWithMMembers(graphs,groups,2,3);
-- show the covariance equivalence groups of the specific graph G
G = digraph({{1,2},{2,3}})
showCovEqGroupOf(graphs,groups,G);
-- check whether a specific conjecture holds on the computed graphs and groups.
-- The conjecture is a function that takes a partition and
-- two graphs and outputs true or false. The conjectureChecker then checks
-- if the inputted conjecture is sufficient and/or necessary for the computed equivalence groups.
-- check whether the classes can be explained by identical edges
conj = (ptt,g1,g2) -> (
e1 = set(edges(g1));
e2 = set(edges(g2));
return isSubset(e1,e2) and isSubset(e2,e1);
)
conjectureChecker(graphs,groups,ptt,conj)
-- check the conjecture from the thesis (implemented in lib/exploreResults.m2)
conjectureChecker(graphs,groups,ptt,conjectureThesis)
-------------------------
-- computing specific vanishing ideals
-------------------------
load "lib/utils.m2"
-- generate polynomial ring and other variables
env = createEnv(3)
-- just vanishing Ideal without any assumptions
G = digraph({{1,2},{2,3}})
vanishingIdeal(env,G)
-- vanishing Ideal ...
-- ... under some partition {{1,2},{3}}
vanishingIdeal(env,G,{{1,2},{3}})
-- ... with maple (if error see docs) (returns ideal as Maple string)
I = vanishingIdeal(env,G,{{1,2},{3}},"maple")
idealMplToM2(I)
-- ... of cyclic graph
G' = digraph({{1,2},{2,3},{3,1}})
vanishingIdeal(env,G',{{1,2},{3}})