As a most general shape, we can write our unitary(unitary here single qubit gates and toffoli gates) in that shape:

$U = \exp({iHt})$

H is the hamiltonian. However single qubit gates does not reqire entanglement. We need just one qubit to apply single qubit gate whereas toffoli gate requires entanglement. Toffoli gate can be written single and two qubit(CNOT) gates. So toffoli gates requires at least two body interaction(hope I am correct until now). And of course there are some quantum optimum pulse techniques to implement toffoli gate at one shot.

My question is how can we prove if a unitary requires 2 body interaction to implement it or not?

For instance when we write the equation $U = exp(iHt)$ what is the next step to prove that? And how can we write/prove it for toffoli gate?

What is the proof differences between toffoli gate and single qubit gate when we try to write to most general shape of the hamiltonian?

Here also another point I am concern is that, I wonder the hamiltonain structure to implement toffoli gate with single shot. I do not want to use single and two qubit gates to implement toffoli gate but I want to implement a direct toffoli gate. For this, what is the general structure of toffoli gate? Maybe this is just a quantum optimum control problem?

  • $\begingroup$ Entanglement is a property of multi-partite systems (non-product states). It does not depend on Hamiltonian, at all $\endgroup$
    – kludg
    Commented Jul 14, 2022 at 5:42
  • $\begingroup$ Thanks but toffoli gate is a multiqubit gate. Something should be different when we write the hamiltonian from the unitary $\endgroup$
    – quest
    Commented Jul 14, 2022 at 5:53
  • $\begingroup$ Sorry, but I think you are fundamentally wrong. Entanglement is not implemented by gates or hamiltonians. $\endgroup$
    – kludg
    Commented Jul 14, 2022 at 6:11
  • 1
    $\begingroup$ You have written the equation $U = \exp({iHt})$ that answers your question, and little can be added to it. Toffoli gate hamiltonians may differ only by speed the gate works. $\endgroup$
    – kludg
    Commented Jul 14, 2022 at 6:36
  • 1
    $\begingroup$ Both U and H for Toffoli gate are 8$\times$8 matrices which indeed modify state of 3-qubit systems. $\endgroup$
    – kludg
    Commented Jul 14, 2022 at 6:51

1 Answer 1


It is true that every unitary can be written as $U=e^{i H t}$ where $H$ is a Hermitian matrix.

Also, if $H$ is a 2-local Hamiltonian acting on $n$ qubits, then $U=e^{i H t}$ is a $2^n \times 2^n$ unitary matrix that may entangle pairs of qubits. The amount of entanglement in each pair depends on the parameter $t$ and the structure of the Hamiltonian $H$.

Let's look at a simple example, let $H = t (X \otimes X \otimes I \otimes \cdots \otimes I)$ acting on $n$ qubits and $t \in \mathbb{R}$. Then we have $$e^{-iH/2} = RXX_{1,2}(t).$$ So, we get a 2-qubit gate $RXX_{1,2}(t)$ that can entangle qubits 1 and 2. The resulting gate introduces "interaction" between the first two qubits.

This example hints that if a Hamiltonian is 2-local then the resulting unitary matrix can entangle pairs of qubits. This implies that the unitary matrix must be implemented with 2-qubit gates. Clearly, if $H$ is a 1-local Hamiltonian, then it will generate a bunch of 1-qubit gates.

Now, let's look at the Toffoli gate. A straightforward calculation of eigenvectors and eigenvalues of the Toffoli gate allows finding the generating Hamiltonian. Note that the ket $(|110\rangle -|111\rangle)/\sqrt{2}$ is the eigenvector of the Toffoli gate with the respective eigenvalue $e^{\pi i}$. The rest of the eigenvectors have eigenvalues $e^{i 0}$. This means the generating Hamiltonian has eigenvalues that are all zero except one eigenvalue which is $-2\pi$. Therefore, the generating Hamiltonian of the Toffoli gate is as follows: $$H = -2\pi \frac{|110\rangle -|111\rangle}{\sqrt{2}} \frac{\langle 110| - \langle 111|)}{\sqrt{2}} = -\pi (|110\rangle -|111\rangle)(\langle 110| - \langle 111|).$$ We can rewrite the above in a matrix form: \begin{equation} H = \begin{pmatrix} O & O & O & O\\ O & O & O & O\\ O & O & O & O\\ O & O & O & \pi(X - I)\\ \end{pmatrix} \end{equation} such that $O$ is a $2\times 2$ zero matrix, $X$ and $I$ are the usual $2\times 2$ Pauli operators. It is straighforwad to verify that what follows holds: $$e^{iH/2} = \textrm{Toffoli}.$$

  • $\begingroup$ hey thanks, just one think are we missing a minus there? I mean U = e^(-iHt)? or should it be U = e^(iHt)? $\endgroup$
    – quest
    Commented Mar 3, 2023 at 1:17
  • $\begingroup$ "-" could be absorbed into $H$ just as I did it for Toffoli. It is problem-dependent, e.g. $e^{-iZt}$ and $e^{iZt}$ are inverses of each other, but both are unitary matrices, one with minus and another without. $\endgroup$
    – MonteNero
    Commented Mar 3, 2023 at 3:40

Your Answer

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

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