title: Denormalize unit vector
body: <p>Suppose I have the unit vector, <strong><em>u</em></strong>.</p>
  
  <pre><code>from numpy import mat
  u = mat([[0.9**0.5], [-(0.1)**0.5]])
  # [ 0.9486833  -0.31622777]
  </code></pre>
  
  <p>The unit vector is an eigenvector of a matrix with integer entries. I also know that the eigenvalues are integers. So, the unit vector will contain irrational decimals that, when squared, are decimal approximations of rational numbers.</p>
  
  <p>Is there any good way to find the smallest value <em>k</em> such that all entries of <em>k<strong>u</em></strong> are integers? In general, <em>k</em> will be the square root of an integer.</p>
  
  <p>A naive approach would be to square each entry in the vector and find the smallest <em>k<sub>i</sub></em> that produces an integer. Then, <em>k</em> will be the square root the of LCM of all <em>k<sub>i</sub></em>. I'm hoping there is a better approach than this.</p>
  
  <hr>
  
  <p>Note that this is not a duplicate of <a href="https://stackoverflow.com/questions/26912479/denormalize-vector">this question</a>.</p>