Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
| Download
Views: 1794
Image: ubuntu2004
1
load("__common__.sage")
2
3
def generator():
4
l1,l2 = sample( list(range(-6,-1))+list(range(1,7)),2)
5
S=matrix([[1,0],[randint(1,3),1]])
6
A=S.inverse()*matrix([[l1,randint(1,2)],[0,l2]])*S
7
8
return {
9
"matrix": A,
10
"e1": l1,
11
"e2": l2,
12
"charpoly": A.charpoly('lambda_'),
13
}
14