numtries=3000(* times to try random numbers *)

 Define lines, as vectors in I^{1,6} 
line=Table[0,{i,27},{j,7}];

s=1;

For[i=1,i≤6,i++, line[[s,i]]=1;s++]

For[i=1,i≤6,i++, 
line[[s,7]]=2;
For[k=1,k≤6,k++, If[k≠i,line[[s,k]]=-1]];
s++
]

For[i=1,i≤6,i++, 
For[j=i+1,j≤6,j++,
line[[s,7]]=1; line[[s,i]]=-1; line[[s,j]]=-1; s++]]

(* line//MatrixForm *)

Define roots, as vectors in I^{1,6} 
root=Table[0,{i,36},{j,7}];

r=1;

For[i=1,i≤6,i++, 
For[j=i+1,j≤6,j++,
root[[r,i]]=1;root[[r,j]]=-1; r++]]

For[i=1,i≤6,i++, 
For[j=i+1,j≤6,j++,
For[k=j+1,k≤6,k++,
root[[r,7]]=1;root[[r,i]]=-1;root[[r,j]]=-1; root[[r,k]]=-1;r++]]]

root[[36,7]]=2; For[i=1,i≤6,i++, root[[36,i]]=-1]

(* root//MatrixForm *)

Lorenzian dot product in I^{1,6}

mdot[x_,y_]:=x[[7]]*y[[7]]-x[[1]]*y[[1]]-x[[2]]*y[[2]]-x[[3]]*y[[3]]-x[[4]]*y[[4]]-x[[5]]*y[[5]]-x[[6]]*y[[6]]

(* Prods=Table[0,{i,36},{j,27}]; *)

(* For[n=1,n≤36,n++, 
For[m=1,m≤27,m++,
 Prods[[n,m]]=mdot[ root[[n]],line[[m]] ] ]] *)

(* Prods//MatrixForm *)

broot=Table[0,{i,6},{j,7}] ;(* a basis of basis roots of E6, the first 6 roots chosen *)

broot[[1]]=root[[21]];

broot[[2]]=root[[1]];

broot[[3]]=root[[6]];

broot[[4]]=root[[10]];

broot[[5]]=root[[13]];
broot[[6]]=root[[15]];

ep=Table[0,{i,21},{j,12}]; (* edges-to-endpoints *)
Paths from the center of the tree T to the endpoints.
(* A,B,C central branches, A0...C1 the next 6, A00...C11 the next 12 *)

For[i=0,i<3,i++,
ep[[7*i+1,4*i+1]]=ep[[7*i+1,4*i+2]]=ep[[7*i+1,4*i+3]]=ep[[7*i+1,4*i+4]]=1; (* A B C *)
ep[[7*i+2,4*i+1]]=ep[[7*i+2,4*i+2]]=1; (* A0 B0 C0 *)
ep[[7*i+3,4*i+3]]=ep[[7*i+3,4*i+4]]=1; (* A1 B1 C1 *)
ep[[7*i+4,4*i+1]]=1;(* A00 B00 C00 *)
ep[[7*i+5,4*i+2]]=1;(* A01 B01 C01 *)
ep[[7*i+6,4*i+3]]=1;(* A10 B10 C10 *)
ep[[7*i+7,4*i+4]]=1 (* A11 B11 C11 *)]

weight={{0,0,0,0,0,0,1},{-1,0,0,0,0,0,1},{-1,-1,0,0,0,0,1},
{0,0,0,1,1,1,-1},{0,0,0,0,1,1,-1},{0,0,0,0,0,1,0}};

(* the next 6 roots *)

fnum=Table[0,{i,6}];
For[num=1,num≤numtries,num++,
For[i=1,i≤6,i++, fnum[[i]]=RandomInteger[{1,36}] ];
(* Print[fnum[[1]],"-",fnum[[2]],"-",fnum[[3]],"-",fnum[[4]],"-",fnum[[5]],"-",fnum[[6]]]; *)
froot=Table[0,{i,6},{j,7}];
For[i=1,i≤6,i++, froot[[i]]=root[[fnum[[i]]]] ];
l=Table[0,{e,21},{s,27},{f,6}];
For[e=1,e≤21,e++,
For[s=1,s≤27,s++,
For[f=1,f≤6,f++,
l[[e,s,f]]=ep[[e,6+f]]*mdot[froot[[f]],line[[s]]];
For[i=1,i≤6,i++,
l[[e,s,f]]=l[[e,s,f]]-ep[[e,i]]*mdot[froot[[f]],weight[[i]]]*mdot[broot[[i]],line[[s]]]; 
]
]
]
];
q=Table[0,{e,21},{s,27},{k,21}];
For[e=1,e≤21,e++,
For[s=1,s≤27,s++,
For[i=1,i<=6,i++,
For[j=1,j≤i,j++,
k=i*(i-1)/2+j;
q[[e,s,k]]=l[[e,s,i]]*l[[e,s,j]];
]
]
]
];
Q=Table[0,{e,21},{s,21}];
For[e=1,e≤21,e++,
For[s=1,s≤27,s++,
Q[[e]]+=q[[e,s]]/6
]
];
mrank=MatrixRank[Q];
If[mrank==21, 
Print["Found: ",Det[Q]," ",fnum[[1]],"-",fnum[[2]],"-",fnum[[3]],"-",fnum[[4]],"-",fnum[[5]],"-",fnum[[6]]]]
]

TimeUsed[]