-
Notifications
You must be signed in to change notification settings - Fork 0
/
commands.sage
102 lines (48 loc) · 2.08 KB
/
commands.sage
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
94
95
96
97
98
99
100
101
102
load('truncated_group_rings.sage')
from itertools import product as iprod
class TGRExample(object):
def __init__(self, G, R):
self.G = G
self.R = R
self.RG = self.G.algebra(self.R)
self.I = TruncatingIdeal(self.RG)
self.Iq = TruncatingIdeal_quick(self.RG)
self.RGt = QuotientRing(self.RG, self.I)
self.RGtq = QuotientRing(self.RG, self.Iq)
self.fs = self.RG.gens()
self.fts = self.RGt.gens()
self.sigma = self.I.gen()
Qw = CyclotomicField(3)
Qi = CyclotomicField(4)
QC3 = TGRExample(AbelianGroup([3]), QQ)
QC3C2 = TGRExample(AbelianGroup([3,2]), QQ)
QC3C3 = TGRExample(AbelianGroup([3,3]), QQ)
QwC3C3 = TGRExample(AbelianGroup([3,3]), Qw)
QwC3C2 = TGRExample(AbelianGroup([3,2]), Qw)
QiC4C4 = TGRExample(AbelianGroup([4,4]), Qi)
w = Qw.gen()
f, g = QwC3C3.fts
basis = [(1+f+f^2) * (1/3), (1+g+g^2) * (1/3), (1+f^2*g+f*g^2) * (1/3), (1+f*g+f^2*g^2) * (1/3)]
for units in iprod([1,g,g^2,-1,-g,-g^2], [1,f,f^2,-1,-f,-f^2],[1,f,f^2,-1,-f,-f^2],[1,f,f^2,-1,-f,-f^2] ):
z = (sum(map(lambda x,y: x*y, units, basis)))
if all(c in ZZ for c in QwC3C3.RGt.lift(z).coefficients()):
show(z)
f, g = QiC4C4.fts
ii = Qi.gen()
z1 = (1 + ii*f - f^2 - ii*f^3)*(1 + ii*g - g^2 - ii*g^3)+ (1 - ii*f - f^2 + ii*f^3)*(1 - ii*g - g^2 + ii*g^3)
z2 = (1 - ii*f - f^2 + ii*f^3)*(1 + ii*g - g^2 - ii*g^3) + (1 + ii*f - f^2 - ii*f^3)*(1 - ii*g - g^2 + ii*g^3)
basis = [(1+f+f^2+f^3)*(1-g+g^2-g^3) * (1/16),
(1+f+f^2+f^3)*(1-g^2) * (1/8),
(1+g+g^2+g^3)*(1-f^2) * (1/8),
(1-g+g^2-g^3)*(1-f^2) * (1/8),
z1 * (1/16),
z2 * (1/16),
(1-f+f^2-f^3)*(1+g+g^2+g^3) * (1/16),
(1-f+f^2-f^3)*(1-g+g^2-g^3) * (1/16),
(1-f+f^2-f^3)*(1-g^2) * (1/8)]
for units in iprod([1,-1], [1,g,-1,-g], [1,f,-1,-f], [1,f,-1,-f],
[1,g,-1,-g], [1,g,-1,-g], [1,-1],
[1,-1], [1,g,-1,-g]):
z = (sum(map(lambda x,y: x*y, units, basis)))
if all(c.is_integer() for c in QiC4C4.RGt.lift(z).coefficients()):
show(z)