answered 0 years ago
Here is an example:
n = 5 Matrix(ZZ,n,n,lambda i,j: 1 if i==j else ZZ.random_element() if i>j else 0)