-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgenerate_data_Li.m
93 lines (85 loc) · 3.49 KB
/
generate_data_Li.m
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
NEval[x_, prec_] := N[x, 3 prec]
(* calculate polylogarithm of order s with precision prec *)
GeneratePoint[s_, prec_, re_, im_] :=
Module[{val = PolyLog[s, re + I im]},
{
NEval[#, prec]& @ {re, im},
{Re[NEval[val, prec]], Im[NEval[val, prec]]}
}
]
(* calculate polylogarithms of order s with precision prec on a
grid *)
GenerateGridData[s_, prec_, {min_, max_, step_}] :=
Flatten /@ Join @@ Table[
GeneratePoint[s, prec, re, im],
{re, min, max, step},
{im, min, max, step}
]
(* calculate polylogarithms of order s with precision prec on a
grid close to unity *)
GenerateUnitData[s_, prec_, n_, frac_, dir_] :=
Flatten /@ Join @@ Table[
GeneratePoint[s, prec, 1 + dir frac^k, im],
{k, 1, n, 1},
{im, 0, 0, 1}
]
(* data arount {re, im} from given direction {reDir, imDir} *)
GenerateLimitData[s_, prec_, n_, frac_, {re_, im_}, {reDir_, imDir_}] :=
Flatten /@ Join @@ Table[
GeneratePoint[s, prec, re + reDir frac^k, im + imDir frac^m],
{k, 1, n, 1},
{m, 1, n, 1}
]
(* data arount {re, im} from all directions *)
GenerateLimitData[s_, prec_, n_, frac_, {re_, im_}] :=
Join[
GenerateLimitData[s, prec, n, frac, {re, im}, {+1, +1}],
GenerateLimitData[s, prec, n, frac, {re, im}, {+1, -1}],
GenerateLimitData[s, prec, n, frac, {re, im}, {-1, +1}],
GenerateLimitData[s, prec, n, frac, {re, im}, {-1, -1}]
]
ExportData[s_, prec_] :=
Module[{data, omega = 1/2 + Sqrt[3]/2, filename},
Print["Generating data for Li" <> ToString[s]];
data = Join[
GenerateGridData[s, prec, {-5, 5, 1/10}],
GenerateGridData[s, prec, {-10, 30, 4/10}],
GenerateGridData[s, prec, {-1000, 1000, 100}],
GenerateUnitData[s, prec, prec, 1/10, -1],
GenerateUnitData[s, prec, prec, 1/10, +1],
GenerateLimitData[s, prec, prec, 1/10, {+1, 0}],
GenerateLimitData[s, prec, prec, 1/10, { 0, 0}],
GenerateLimitData[s, prec, prec, 1/10, {-1, 0}]
(* Join @@@ { *)
(* GeneratePoint[s, prec, 0 , 0], *)
(* GeneratePoint[s, prec, 1/2, 0], *)
(* GeneratePoint[s, prec, 1 , 0], *)
(* GeneratePoint[s, prec, 3/2, 0], *)
(* GeneratePoint[s, prec, -0 , 0], *)
(* GeneratePoint[s, prec, -1/2, 0], *)
(* GeneratePoint[s, prec, -1 , 0], *)
(* GeneratePoint[s, prec, -3/2, 0], *)
(* GeneratePoint[s, prec, -(Sqrt[5] - 1)/2, 0], *)
(* GeneratePoint[s, prec, -(Sqrt[5] + 1)/2, 0], *)
(* GeneratePoint[s, prec, (Sqrt[5] + 1)/2, 0], *)
(* GeneratePoint[s, prec, (Sqrt[5] + 3)/2, 0], *)
(* GeneratePoint[s, prec, omega, 0], *)
(* GeneratePoint[s, prec, omega^2, 0], *)
(* GeneratePoint[s, prec, 1 + omega, 0], *)
(* GeneratePoint[s, prec, 1/(1 + omega), 0] *)
(* } *)
];
filename = "Li" <> ToString[s] <> ".txt";
Print["Writing data to ", filename];
Export[filename, data, "Table"];
]
ExportData[2, 40];
ExportData[3, 40];
ExportData[4, 40];
ExportData[5, 40];
ExportData[6, 40];
ExportData[1/2, 40];
ExportData[3/2, 40];
ExportData[5/2, 40];
ExportData[21/2, 40];
ExportData[41/2, 40];