Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from numpy import ones, any, eye
- from random import randint
- def attemptHadamard(mat):
- mat[randint(0, 667)][randint(0, 667)] *= -1
- if checkHadamard(mat):
- print('Success!\n', mat)
- return True
- else:
- return False
- def checkHadamard(mat):
- return not (mat.transpose() @ mat - 668 * eye(668)).any()
- mat = ones([668, 668])
- while not attemptHadamard(mat):
- pass
- while True:
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement