load "Conj_Z";
B_3:=[rep_Mred(FactorNumberListsShort,Mat1_Mred2,Mat2_Mred2)(g): g in G3];
B_4:=[rep_Mred(FactorNumberListsShort,Mat1_Mred,Mat2_Mred)(g): g in G3];
B_th:=[<1, B_3[i],B_4[i],B_conj[i][3],B_conj[i][4],B_conj[i][5]>: i in [1..#G3]];
load"conj_elements_Ztheta";

C_8:=MatrixRing(K,8)!&*Conj_7_6;
C_7:=MatrixRing(K,7)!&*Conj_8_5;
C_6:=MatrixRing(K,6)!&*Conj_8_4;
C_32:=MatrixRing(K,3)!(&*Conj_7_3*&*Conj_8_3);
C_31:=MatrixRing(K,3)!(&*Conj_7_2*&*Conj_8_2);
C_8_inv:=C_8^-1;
C_7_inv:=C_7^-1;
C_6_inv:=C_6^-1;
C_32_inv:=C_32^-1;
C_31_inv:=C_31^-1;
C:=<1,C_31,C_32,C_6,C_7,C_8>;

print("Calculation of list B_conj_th of  conjugated Wedderburnimages for each group element (takes about 1min)");
B_conj_th:=[<1,C_31_inv*x[2]*C_31,C_32_inv*x[3]*C_32,C_6_inv*x[4]*C_6,C_7_inv*x[5]*C_7, C_8_inv*x[6]*C_8>: x in B_th];
Bs_th:=[[ElementToSequence(B_conj_th[i][j]) : j in [1..6]]: i in [1..#G3]]; 

Bmat_th:=RMatrixSpace(K,168,168)![&cat Bs_th[i] : i in [1..#G3]]; 
Z_K:=MaximalOrder(K);
Bmat_th_inv:=Bmat_th^-1; 
Z_K_Bmat_inv:=RMatrixSpace(Z_K,168,168)!(168*Bmat_th_inv); 
Z_K_8:=quo<Z_K|8>;
Z_K_3:=quo<Z_K|3>;
Z_K_7:=quo<Z_K|7>;

Z_K_Bmat_mod3:=RMatrixSpace(Z_K_3,168,168)!(Z_K_Bmat_inv); 
Z_K_Bmat_mod7:=RMatrixSpace(Z_K_7,168,168)!(Z_K_Bmat_inv); 
Z_K_Bmat_mod8:=RMatrixSpace(Z_K_8,168,168)!(Z_K_Bmat_inv); 

print("Calculation of the congruences (takes about 1min)");
E_mod3,H_3:=EchelonForm(Transpose(Z_K_Bmat_mod3));
E_mod3:=Transpose(E_mod3);
H_3:=Transpose(H_3);
E_mod7,H_7:=EchelonForm(Transpose(Z_K_Bmat_mod7));
E_mod7:=Transpose(E_mod7);
H_7:=Transpose(H_7);
load "Congruences_modulo_8";
E_mod8:=Z_K_Bmat_mod8*H_8;
E_3:= [[<i,E_mod3[i,s]>: i in [1..168]| E_mod3[i,s] ne 0]: s in [1..Rank(E_mod3)]];
E_7:= [[<i,E_mod7[i,s]>: i in [1..168]| E_mod7[i,s] ne 0]: s in [1..Rank(E_mod7)]];
E_8:= [[<i,E_mod8[i,s]>: i in [1..168]| E_mod8[i,s] ne 0]: s in [1..Rank(E_mod8)]];

print("type: charactercheck(B_th,i,CT);, to obtain the number of the character of ~omega_i in the charactertable (i must be an element of {1,31,32,6,7,8})");
print("type: C; to see the element with whom was conjugated");
print("the list B_conj consists of the conjugated Wedderburnimages for each group element, B_conj[8] is the image of g1, B_conj[2] is the image of g2");
print("type: E_3; to see the congruences modulo 3");
print("type: E_7; to see the congruences modulo 7");
print("type: E_8; to see the congruences modulo 8");

