title: How to write unitary transformation of matrix in Python
body: <p>Given the set of matrix,supposedly the transpose of conjugate IV will obtain the UB:</p>
  
  <pre><code>IV_transpose*UB(IV)=UB
  </code></pre>
  
  <p>However, I get the different output. Please see the code;</p>
  
  <pre><code>angle=60
  UB = np.array([
      [1,0,0,0],
      [0,math.cos(4*math.radians(angle)),math.sin(4*math.radians(angle)),0],
      [0, math.sin(4 * math.radians(angle)), -math.cos(4 
      *math.radians(angle)),0],[0,0,0,-1]])
  
  IV = [[1.0],[1.0],[0.0],[0.0]]
  
  IVT=np.conj(IV).T
  UBIV=np.matmul(UB,IV)
  output=np.matmul(IVT,UBIV)
  print (output)
  print (UB)
  </code></pre>
  
  <p>This is my output:</p>
  
  <pre><code>IV_transpose*UB(IV)=[[ 0.5]]
  UB=
  [[ 1.         0.         0.         0.       ]
  [ 0.        -0.5       -0.8660254  0.       ]
  [ 0.        -0.8660254  0.5        0.       ]
  [ 0.         0.         0.        -1.       ]]
  </code></pre>
  
  <p>My question is why <code>IV_transpose*UB(IV)!=UB</code>.
  How to make it equal?
  Thank you.</p>