... you notice that it has some issues with matrix manipulations
after adjusting the brackets, you get:
import numpy as np
s = np.array( [[1.,3.,5.],[3.,2.,6.], [5.,6.,1.] ])
x = np.array( [[1.,3.,5.],[2.,4.,6.] ])
res= x @ (s @ x.T)
print(res)
print(res.diagonal())
... which fits to
Names Default To Here( 1 );
exS = [1 3 5, 3 2 6, 5 6 1];
exX = [1 3 5, 2 4 6];
Print(r= exX * exS * exX`);
tmp=as list(r);
print(tmp[1][1],tmp[2][2])