build syntax rule and opMatrices, python methods needed for optimization and matrix operations