Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Try recursive method in hadamard_matrix only if it will be successful
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoCati authored and dimpase committed Oct 23, 2022
1 parent 57a2d1d commit 822b99a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sage/combinat/matrices/hadamard_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,9 @@ def hadamard_matrix(n,existence=False, check=True):
if existence:
return True
M = hadamard_matrix_paleyII(n)
elif n == 4 or n % 8 == 0:
elif n == 4 or n % 8 == 0 and hadamard_matrix(n//2,existence=True) is True:
if existence:
return hadamard_matrix(n//2,existence=True)
return True
had = hadamard_matrix(n//2,check=False)
chad1 = matrix([list(r) + list(r) for r in had.rows()])
mhad = (-1) * had
Expand Down

0 comments on commit 822b99a

Please sign in to comment.