Sharedsupport / 2015-05-20-matrices.sagewsOpen in CoCalc
Author: William A. Stein
License: GNU General Public License v3.0
Description: Examples for support purposes.

"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]