Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can use radical_expression:

sage: P = matrix([[1,1,0],[0,1,1],[1,0,0]])
sage: lamda = P.eigenvectors_right()[0][0]
sage: lamda
1.754877666246693?
sage: lamda.radical_expression()
(1/18*sqrt(23)*sqrt(3) + 25/54)^(1/3) + 1/9/(1/18*sqrt(23)*sqrt(3) + 25/54)^(1/3) + 2/3
sage: type(_)
<type 'sage.symbolic.expression.Expression'>

You can use radical_expression:

sage: P = matrix([[1,1,0],[0,1,1],[1,0,0]])
sage: lamda = P.eigenvectors_right()[0][0]
sage: lamda
1.754877666246693?
sage: lamda.radical_expression()
(1/18*sqrt(23)*sqrt(3) + 25/54)^(1/3) + 1/9/(1/18*sqrt(23)*sqrt(3) + 25/54)^(1/3) + 2/3
sage: type(_)
<type 'sage.symbolic.expression.Expression'>

By the way, the behavior if the algebraic number has no radical expression :

sage: x = ZZ['x'].gen()
sage: mu = (x^5 - x - 1).roots(QQbar, multiplicities=False)[0]
sage: mu
1.167303978261419?
sage: mu.radical_expression()
1.167303978261419?