def dense_orth(dim):
 from scipy import rand
 from scipy.linalg import orth
 return orth(rand(dim, dim))

def dense_orth ( dim ) : from scipy import rand from scipy . linalg import orth return orth ( rand ( dim , dim ) )
constructs a dense orthogonal matrix .