I want to implement a unitary $U\,,$ $$U=\text{exp}(-it|u\rangle\langle u|)\,,$$ where $|u\rangle$ is a known state.

Are there any methods to do this efficiently?

  • $\begingroup$ What do you know about $|u\rangle$? For example, do you know that there exists a unitary $V$ that you can construct such that $|u\rangle=V|0\rangle$. $\endgroup$
    – DaftWullie
    Apr 12 at 6:30
  • $\begingroup$ yeah all information of |u> is known, suppose there exists a unitary V one can construct such that |u⟩=V|0⟩ $\endgroup$
    – mingo
    Apr 12 at 9:19

1 Answer 1


Let's assume that we know the circuit $V$ the constructs $|u\rangle$, i.e. $$ V|0\rangle=|u\rangle. $$ So, this reduces our problem to creating the evolution $$ V^\dagger UV=e^{-it|0\rangle\langle 0|}. $$ This is quite straightforward. For our computational register, we can ask "is it in the state $|0\rangle$?" essentially by applying $X$ on every qubit, and doing a multi-controlled-not targeting an ancilla initially in $|0\rangle$. Next, you simply apply a phase gate $|0\rangle\langle 0|+e^{-it}|1\rangle\langle 1|$ on the ancilla, before undoing the entanglement between ancilla and computational register by repeating the multi-controlled-not.

enter image description here

  • $\begingroup$ Thank you very much! Your method is quite useful. $\endgroup$
    – mingo
    Apr 13 at 9:24

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.