Created
February 15, 2023 21:02
-
-
Save RobertTalbert/1ca88362aa812df708d3eb8a05f6a684 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
from sympy import * | |
def niceEigs(e1,e2): | |
M = Matrix([[e1,0],[0,e2]]) | |
P = randMatrix(2,2,-3,3) | |
while P.det() == 0: | |
# Change the -3 and 3 if you want more variety in the entries | |
P = randMatrix(2,2,-3,3) | |
return P*M*P.inv() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment