title: Mathematica matrix diagonalization
body: <p>I'm considering a matrix A such that A=PDP^-1.</p>
  
  <p>The way I solve this using Mathematica is:</p>
  
  <pre><code>a={{0, -1}, {-1, 0}}
  d = DiagonalMatrix[Eigenvalues[a]]
  {{-1,0}, {0,1}}
  p = Transpose[Eigenvectors[a]]
  
  p.d.Inverse[p]
  {{0, -1}, {-1, 0}}
  </code></pre>
  
  <p>Which is correct.</p>
  
  <p>Problem is, the P matrix is not what I expected it to be. The matrix that Mathematica generates is</p>
  
  <pre><code>p={{1, -1}, {1, 1}}
  </code></pre>
  
  <p>But I am looking for</p>
  
  <pre><code>p2={{1/Sqrt[2], 1/Sqrt[2]}, {1/Sqrt[2], -(1/Sqrt[2])}}
  p2.d.Inverse[p2]
  {{0,-1}, {-1,0}}
  </code></pre>
  
  <p>Which also solves the equation. Is there a way for me to force Mathematica to show me different answers when executing Transpose[Eigenvectors[a]]?</p>