0
$\begingroup$

I can prepare a state $|1\rangle|x\rangle|0\rangle$ using HHL. How do I prepare $|1\rangle|x\rangle|0\rangle+|0\rangle|y\rangle|0\rangle$ or simply $|1\rangle|x\rangle|0\rangle+|0\rangle|0\rangle|0\rangle$ in quantum circuit?

Edit: $|1\rangle|x\rangle|0\rangle$ must be prepared with HHL algorithm. So, x can be considered an unknown(y is known). Right most $|0\rangle$ is not unused from start to end, as it is also part of HHL. So it gets entangled in mid of HHL operation. Left most $|1\rangle$ is the ancilla qubit of HHL.

$\endgroup$

1 Answer 1

3
$\begingroup$

You have three registers. The rightmost third register is not entangled with the first or second register, neither at the beginning in $|1\rangle |x\rangle |0\rangle$ nor at the end in $|1\rangle |x\rangle |0\rangle + |0\rangle | y\rangle |0\rangle$. So we don't need to worry about it now. It could have been used at one time but it’s uncomputed here, so it’s unentangled in the setup of the question. It can be thrown away.

Turning to the second middle register, if $|x\rangle$ is unknown, with the setup of the question it is still preparable with a known circuit starting from a fiducial state. Call that process $U$. Call the process to prepare the second register into $|y\rangle$ $V$, again starting from the fiducial state. Importantly you can use the first register to control operation onto the second.

To entangle the first and second registers together, you'll need to (A) put the leftmost first register into a superposition such as $\frac{1}{\sqrt 2}(|0\rangle+|1\rangle)$, and (B) use this first register as a control to map the second register into $|x\rangle$ if the first register is $|1\rangle$ by running $U$, otherwise to $|y\rangle$ or $|0\rangle$ if the first register is $|0\rangle$ by running $V$.

You can put the first leftmost register into $\frac{1}{\sqrt 2}(|0\rangle+|1\rangle)$ by first negating it if it's in $|1\rangle$ and then doing a Hadamard gate afterwards.

You can do the controlled entangling operation with various controlled operations, such as one or more of CX, CY, CZ, or CCNOT (Toffoli).

$\endgroup$
2
  • $\begingroup$ Thank you for the answer. However ,|1⟩|x⟩|0⟩ must be prepared with HHL algorithm. So, x can be considered an unknown(y is known). Right most |0⟩ is not unused from start to end, as it is also part of HHL. So it gets entangled in mid of HHL operation. Left most |1⟩ is the ancilla qubit of HHL. $\endgroup$ Commented Sep 13, 2024 at 0:27
  • $\begingroup$ The rightmost $|0\rangle$ is there at the beginning of the computation and has been uncomputed by the end, thus it can be discarded at the end. Otherwise I don’t understand your question. Good luck! $\endgroup$ Commented Nov 11 at 3:31

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.