Created
June 1, 2020 17:16
-
-
Save mynameisvinn/accfdd9188c0002d2b6f665f690e59b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# we know the following graph is nilpontent | |
m = np.array([[0, 1, 0, 0, 0, 0], | |
[0, 0, 1, 1, 0, 0], | |
[0, 0, 0, 0, 0, 0], | |
[0, 0, 0, 0, 1, 1], | |
[0, 0, 0, 0, 0, 1], | |
[0, 0, 1, 0, 0, 0]]) | |
for k in range(len(m)): | |
print(m) | |
print("-" * 15) | |
m = m.dot(m) | |
if np.sum(m) == 0: | |
print("finished at", k, "multiplies") | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment