I am new to quantum computing and I am having trouble understanding the notation used for input/output qubits in quantum gates. I will use the CNOT gate as an example.
In several (most) references I've seen, the CNOT operation is defined as follows:
CNOT: $$|x⟩|y⟩ \to |x⟩|x \oplus y\rangle,$$
with the following circuit representation:
This input/output qubit notation seems to work well when the CNOT is being used in classical reversible computation, or when $|x\rangle$ and $|y\rangle$ are strictly qubits in the standard basis that are not in superposition:
$$|00\rangle \to |00\rangle$$
$$|01\rangle \to |01\rangle$$
$$|10\rangle \to |11\rangle$$
$$|11\rangle \to |10\rangle$$
So, as described by the definition/circuit:
The first qubit remains unchanged: $|x\rangle \to |x\rangle$.
The second qubit flips when the first qubit is equal to 1: $$|y⟩ \to |x\oplus y⟩.$$
Now, if the input qubits $|x\rangle$ and $|y\rangle$ do not strictly align with the standard basis, the input/output notation seems rather strange to me (actually, extremely confusing to be honest). For instance, if $|x⟩$ and $|y\rangle$ are qubits aligned with the Hadamard basis as follows:
$$|x\rangle = |+\rangle = \frac{1}{\sqrt2} (|0\rangle + |1\rangle)$$
$$|y\rangle = |-\rangle = \frac{1}{\sqrt 2} (|0\rangle - |1\rangle)$$
Then the CNOT operation will result in:
$$|+-\rangle \to |--\rangle$$
This means that $|x\rangle$ changed from $|+\rangle$ to $|-\rangle$, when the notation seems to say it should have stayed the same.
Furthermore, if the output bits end up entangled, then my output result can't really be represented as $|x⟩|x \oplus y\rangle = |x\rangle \otimes |x \oplus y\rangle$ because I can't describe that final state as two separate qubits.
So, my question(s) is (are):
- Am I supposed to know that the input $|x\rangle$ and output $|x\rangle$ do not have to be the same in value or even an independent value in the case when it's entangled?
- Is this notation is only valid for when $|x\rangle$ and $|y\rangle$ are orthonormal qubits in the standard basis?
- Is this just poor notation in general and I should try to avoid it?
- If so, why is it so common across quantum computing references, and is there a better way to express this?