-
Notifications
You must be signed in to change notification settings - Fork 0
/
halfsymplecticmatrices.txt
62 lines (57 loc) · 1.25 KB
/
halfsymplecticmatrices.txt
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
\\ H = [A, B] is a half-symplectic matrix.
rank(H) = #H[1]
{
oneMinus(H, i) =
local(A, B, Hnew);
[A, B] = H;
[A[,i], B[,i]] = [B[,i], A[,i]];
Hnew = [A, B];
return(Hnew)
}
{
oneOver(H, i) =
local(A, B, Hnew);
[A, B] = H;
[A[,i], B[,i]] = [B[,i] - A[,i], B[,i]];
Hnew = [A, B];
return(Hnew)
}
{
renumber(H, i) =
local(H1, H2, Hvec);
H1 = oneMinus(oneOver(H, i + 1), i + 1);
H2 = oneOver(oneMinus(H, i + 1), i + 1);
if(i == rank(H) - 1,
Hvec = [H, H1, H2],
Hvec = concat(renumber(H, i + 1), concat(renumber(H1, i + 1), renumber(H2, i + 1)))
);
return(Hvec)
}
\\ H has rank 2
{
twoThree(H) =
local(A, B, Anew, Bnew, Hnew);
[A, B] = H;
Anew = [-1, 0, 0;
B[1,1] + B[1,2], B[1,1] - A[1,1] + A[1,2], B[1,2] + A[1,1] - A[1,2];
B[2,1] + B[2,2], B[2,1] - A[2,1] + A[2,2], B[2,2] + A[2,1] - A[2,2]];
Bnew = [-1, 1, 1;
0, -A[1,1], -A[1,2];
0, -A[2,1], -A[2,2]];
Hnew = [Anew, Bnew];
return(Hnew)
}
\\ H has rank 2
{
allTwoThree(H) =
local(Hvec, Hvec1);
Hvec = renumber(H);
for(n = 1, #Hvec,
Hvec[n] = twoThree(Hvec[n])
);
Hvec1 = [];
for(n = 1, #Hvec,
Hvec1 = concat(Hvec1, renumber(Hvec[n]))
);
return(Hvec1)
}