# eigendecomposition of continuous formalism Hadamard gate for arbitrary amount of qubits

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.

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]])

• 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. – Nathaniel Dec 5 '17 at 5:42
• 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. – Marek Dec 12 '17 at 4:36