I'm addressing the implementation with gates of an algorithm where there is the need of creating a qubit register $|\Psi\rangle$ starting from two input qubit registers $|a\rangle$ and $|b\rangle$, obtaining $$|\Psi\rangle = \frac{1}{k}(|0\rangle|a\rangle + |1\rangle|b\rangle)$$ with $k$ being a normalisation factor $\sqrt 2$. How that can be obtained using quantum gates starting from $|a\rangle$, $|b\rangle$ and ancilla qubits as needed?
3 Answers
If I understand your question correctly, you're asking if it's possible to be given two unknown states $|a\rangle$ and $|b\rangle$, which may not be orthogonal, and you want to know if there's a transformation $$ |a\rangle|b\rangle\mapsto\frac{1}{\sqrt{2}}(|0a\rangle+|1b\rangle). $$
In general, this is impossible to realise deterministically. Let me give a sketch of a proof (it's similar to a standard proof of no cloning).
If we want this to be a unitary evolution, then we need some ancilla states. Thus, we'd be after the transformation $$ |a\rangle|b\rangle|s\rangle\mapsto\frac{1}{\sqrt{2}}(|0a\rangle+|1b\rangle)|t_{ab}\rangle. $$ Now, let's consider two particular inputs, $a=0$ and $b=0$ or 1. We need $$ |0\rangle|0\rangle|s\rangle\mapsto\frac{1}{\sqrt{2}}(|00\rangle+|10\rangle)|t_{0}\rangle \\ |0\rangle|1\rangle|s\rangle\mapsto\frac{1}{\sqrt{2}}(|00\rangle+|11\rangle)|t_{1}\rangle. $$ Using linearity, we can therefore infer what the evolution has to be for any input $|b\rangle$ when $a=0$: $$ |0\rangle(\alpha|0\rangle+\beta|1\rangle)|s\rangle\mapsto\frac{1}{\sqrt{2}}(\alpha|00\rangle|t_0\rangle+\alpha|10\rangle|t_0\rangle+\beta|00\rangle|t_1\rangle+\beta|11\rangle|t_1\rangle) $$ but it should be $$ \frac{1}{\sqrt{2}}(|00\rangle+\alpha|10\rangle+\beta|11\rangle)|\tilde t\rangle. $$ To achieve equality, we'd need $|\tilde t\rangle=|t_1\rangle=|t_0\rangle$ and $(\alpha|t_0\rangle+\beta|t_1\rangle)=|\tilde t\rangle$. This can only happen if $\alpha\beta=0$, i.e. for the two cases we fixed initially; no other case works, making the transformation impossible.
I'm sure one could improve the structure of this proof so that you don't have to make as many assumptions about what's included in the possible set of states to do this with.
If the two states $|a\rangle$ and $|b\rangle$ are guaranteed to be orthogonal, in a known basis, I believe that the transformation is achievable.
- 62,671
- 4
- 55
- 140
It's impossible if $|a\rangle, |b\rangle$ are unknown, as DaftWullie proved in his answer.
Though, you can construct another operation, that might suit your needs $$|0\rangle|a\rangle|b\rangle \mapsto \frac{1}{\sqrt{2}}(|0\rangle|a\rangle|b\rangle + |1\rangle |b\rangle|a\rangle)$$ Just use $H$ on the first qubit, and then controlled swap of the two last registers.
If $|a\rangle,|b\rangle$ are known in advance, then you can construct whatever you want.
- 8,076
- 13
- 24
I haven’t seen a simple way for preparing this new state, however it does not mean it is not achieveable.
Assuming $a$ and $b$ are both states corresponding classical $n$-bit binary integers, the end states will be a entangled state corresponding to two $n+1$ bit integers.
You will need to have $n+1$ qubits all in $|+\rangle$ states, then use Grover’s algorithm to search for the two states that matches the $n+1$ bit binary integers. Of couse this will take $\sqrt{N}$ steps to achieve the target state with desired accuracy.
- 93
- 5