# Quantum gates for more than two basis states

Lets say I have a time dependent hamiltonian of the form $$H(t) = H_0 + f(t) H_{drive}$$ (where $$H_0$$ may represent the hamiltonian for a superconducting qubit) and I want to find the optimal pulse $$f(t)$$, such that the infidelity between some target gate $$U_{goal}$$ and evolved gate $$U(T)$$ is minimal. Where $$U(T) = {\mathcal T}\exp\left(\int_0^T -iH(t)dt\right)$$

If I where to include the first $$d$$ basis states of the qubit into my optimization, the resulting hamiltonian, and therefore also the evolved gate $$U(T)$$, would be of dimension $$d\times d$$.

The question: How would my target gate $$U_{goal}$$ look like for cases with $$d>2$$? Because, for example, if my target gate would be the standard Hadamard gate (which has dimensions of $$2\times 2$$), the dimension of $$U_{goal}$$ and $$U(T)$$ won't be identical anymore.

Would it be of the form $$U_{goal} = H_2 \oplus \mathbf{I}_{}$$ (example for $$d=4$$)

$$\begin{bmatrix}1/\sqrt{2} & 1/\sqrt{2} & 0 & 0\\1/\sqrt{2} & -1/\sqrt{2} & 0 & 0\\0 & 0 & 1 & 0\\0 & 0 & 0 & 1 \end{bmatrix}$$

or would it be something else?

I would highly appreciate any input on this, thank you!

If you want the best possible evolution for your qubit space, then you simply don't define what your target is on the rest of the space - so long as you always start in the two-dimensional subspace/subsystem and end there, it doesn't matter what happens outside it. So, you'd probably set $$U_{goal}=H_2\oplus U'$$ where $$U'$$ is any (unspecified) unitary. Your measure of the infidelity should only be over the two-dimensional component.
• Thanks for taking the time to answer! I see, so I guess I could leave the target gate just as $U_{goal} = H_2$ and when it comes to calculating the infidelity I just cut out the top left $2\times 2$ part of my evolved gate... Thank you! Apr 22 at 16:05