Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Project: TestPlace
Views: 31
1
A.<u,v,w>=QuaternionAlgebra(2,3)
2
3
4
Id=identity_matrix(2)
5
U=matrix([[sqrt(2),0],[0,-sqrt(2)]])
6
V=matrix([[0,1],[3,0]])
7
W=U*V
8
9
E0=Id
10
E1=U
11
E2=(1/2)*Id+(1/2)*U+(1/2)*V
12
E3=(1/2)*U+(1/2)*W
13
B=[E0,E1,E2,E3]
14
15
# Robust way to generate the list of matrices
16
maxm = 5 #set the range
17
L = []
18
for i in range(-max,max):
19
for j in range(-max,max):
20
for k in range(-max,max):
21
for l in range(-max,max):
22
temp = i*B[0] + j*B[1] + k*B[2] + l*B[3]
23
if temp.determinant() == 1:
24
L.append(temp)
25
26
27
print(str(len(L)) + " matrices are selected in L")
28
29
#S.<a,b>=QQ[]
30
31
#P = matrix([[a,b],[b,1-a]])
32
33
#INEQS=[(g.transpose()*P*g-P).trace() for g in L]
34
35
def coeff(F):
36
C=[]
37
C.append((F.coefficient({a:0,b:0})))
38
C.append((F.coefficient({a:1,b:0})))
39
C.append((F.coefficient({a:0,b:1})))
40
return C
41
42
ineqs=[]
43
44
for F in INEQS:
45
ineqs.append(coeff(F))
46
47
poly=Polyhedron(ieqs=ineqs,base_ring=AA)
48
# Format printing
49
print(poly)
50
print("\n Vertices are:")
51
for j in poly.Vrepresentation():
52
print("(" + str(j[0].radical_expression()) + " , " + str(j[1].radical_expression()) + ")")
53