I have a problem in my simulation. I need to simulate a Hadamard gate by integrating Schrödinger equation (time evolution).

This requires me to construct a Hamiltonian operator related to Hadamard gate and perform a time evolution, so I would also need eigenvalues.

My problem is, all resources I can find about quantum gates are in unitary formalism (discrete time), I don't manage to find useful resources for continuous time case, especially with eigenvalues.

From Quantum Computation and Quantum Information by Nielsen and Chuang page 83

There is therefore one-to-one correspondence between discrete-time description of dynamics using unitary operators and the continuous time description using Hamiltonians

I just don't know how to find Hamiltonian related to Hadamard gate.

I found some examples such as paper A Sequence of Quantum Gates page 5, but it doesn't scale up for more than single qubit and doesn't mention eigendecomposition, which is required for efficient time evolution as H easily becomes a huge matrix and it is difficult to exponentiate.


1 Answer 1


To get a Hamiltonian that generates a unitary matrix (times i), you take the logarithm of the unitary matrix.

$$e^{-iH} = U$$ $$-iH = \ln U$$ $$H = i\ln U$$

You can use tools like matlab or scipy to compute matrix logarithms, or do it by hand via eigendecomposition. For example:

>>> import scipy.linalg
>>> scipy.linalg.logm([[1, 1], [1, -1]]).round(1)
array([[ 0.3+0.5j,  0.0-1.1j],
       [ 0.0-1.1j,  0.3+2.7j]])
  • $\begingroup$ It would be worth adding to this answer the following: Let $H=i\ln U$. Then if $\lambda$ is an eigenvalue of $U$, then $i\ln \lambda$ is an eigenvalue of $H$. (Where $\ln$ is just the usual complex logarithm of course.) Furthermore, the corresponding eigenvector of $H$ is the same as the corresponding eigenvector of $U$. So if you have the eigenvalues in the unitary formalism you have them also in the Hamiltonian one automatically. $\endgroup$
    – N. Virgo
    Dec 5, 2017 at 5:42
  • $\begingroup$ Thank you for answer, but I was hoping more for getting some tips on how to do it analytically, for example exploiting some symmetries and repeating patterns inside of the matrix to make it work for arbitrary size and avoiding diagonalizing large matrices numerically. $\endgroup$
    – Marek
    Dec 12, 2017 at 4:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.