ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 05 Jun 2015 06:32:26 -0500How does one detect cyclic vectors in SAGE?http://ask.sagemath.org/question/27025/how-does-one-detect-cyclic-vectors-in-sage/
Given a vector $v$ and a matrix $A$ of dimension $n$, one would say that $v$ is a cyclic vector of $A$ if the following set is linearly independent $\{ v,Av,A^2v,..,A^{n-1}v \}$.
Is there a way to test this property on SAGE given a $v$ and a $A$? Thu, 04 Jun 2015 15:12:06 -0500http://ask.sagemath.org/question/27025/how-does-one-detect-cyclic-vectors-in-sage/Answer by tmonteil for <p>Given a vector $v$ and a matrix $A$ of dimension $n$, one would say that $v$ is a cyclic vector of $A$ if the following set is linearly independent ${ v,Av,A^2v,..,A^{n-1}v }$. </p>
<p>Is there a way to test this property on SAGE given a $v$ and a $A$? </p>
http://ask.sagemath.org/question/27025/how-does-one-detect-cyclic-vectors-in-sage/?answer=27027#post-id-27027You can get the list of vectors as follows:
sage: [A^k*v for k in range(n)]
Then you can check that they are linearly independent by looking at the determinant of the matrix made with those vectors:
sage: det(matrix([A^k*v for k in range(n)]))
Or,
sage: matrix([A^k*v for k in range(n)]).is_invertible()
Fri, 05 Jun 2015 06:32:26 -0500http://ask.sagemath.org/question/27025/how-does-one-detect-cyclic-vectors-in-sage/?answer=27027#post-id-27027