| Hosted by CoCalc | Download

"I am trying to create the set of 3x3 matrices which have entries in the set [0,1,-1]"

v = [] for x in cartesian_product_iterator([[0,1,-1]]*9): v.append(matrix(3,x))
len(v)
19683
v[0]
[0 0 0] [0 0 0] [0 0 0]
v[10]
[0 0 0] [0 0 0] [1 0 1]