User:DavidBoden/sandbox

Circuits that provide a constant output of either $$|0\rangle$$ or $$|1\rangle$$ can be viewed as having the output qubit disconnected from the input qubits. It is therefore expected that the input qubits measure as $$|0\rangle^{\otimes n}$$.

In the circuit diagrams, the functions are shown within a dashed line border. It is important to note that an $$X$$ gate that flips $$|0\rangle$$ to $$|1\rangle$$ has no effect in the Hadamard basis. $$|+\rangle$$ passes through an $$X$$ gate unchanged.

A sub-class of balanced functions uses only a single input qubit to decide whether the output qubit is $$|0\rangle$$ or $$|1\rangle$$.

Separating the Bell State $$|\Phi^+\rangle$$
When the CNOT gate acts upon two qubits that are perfectly correlated in the $$|\Phi^+\rangle$$ state, the outputs are the unentangled states $$|+\rangle_A$$ and $$|0\rangle_B$$. The CNOT gate is its own inverse.

To demonstrate this, we show that in any chosen basis the perfect correlation and the operation of the CNOT gate combine to produce a constant output.

Selecting the computational basis $$\{|0\rangle,|1\rangle\}$$ we have:

Qubit A's effect on qubit B
Based on qubit B correlating exactly with qubit A and then qubit B being subjected to the CNOT X-rotation depending on qubit A:

$$|0\rangle_A$$ correlates to $$|0\rangle_B$$ which results in $$|0\rangle_B$$

$$|1\rangle_A$$ correlates to $$|1\rangle_B$$ which results in $$|0\rangle_B$$

Qubit B's effect on qubit A
The basis vectors that we've chosen, represented by Hadamard basis vectors are:

$$\{\frac{1}{\sqrt{2}}(|+\rangle + |-\rangle), \frac{1}{\sqrt{2}}(|+\rangle - |-\rangle)\}$$

$$\frac{1}{\sqrt{2}}(|+\rangle_B + |-\rangle_B)$$

Separates into:

$$\frac{1}{2}(|+\rangle_A + |-\rangle_A)$$ and $$\frac{1}{2}(|-\rangle_A + |+\rangle_A)$$

The other basis vector:

$$\frac{1}{\sqrt{2}}(|+\rangle_B - |-\rangle_B)$$

Separates into:

$$\frac{1}{2}(|+\rangle_A - |-\rangle_A)$$ and $$\frac{-1}{2}(|-\rangle_A - |+\rangle_A)$$

So the resulting state of summing the results of the basis transformations (and dividing by 2) is the constant:

$$|+\rangle_A$$

Further worked example
Using an arbitrarily-selected basis of: $$\{\frac{1}{5}(3|0\rangle + 4|1\rangle), \frac{1}{5}(3|1\rangle - 4|0\rangle)\}$$

Qubit A's effect on qubit B
Based on qubit B correlating exactly with qubit A and then qubit B being subjected to the CNOT X-rotation depending on qubit A:

$$\frac{1}{5}(3|0\rangle_A + 4|1\rangle_A)$$

Separates into:

$$\frac{3}{25}(3|0\rangle_B + 4|1\rangle_B)$$ and $$\frac{4}{25}(3|1\rangle_B + 4|0\rangle_B)$$ which equals $$\frac{25}{25}|0\rangle_B + \frac{24}{25}|1\rangle_B$$

The other basis vector:

$$\frac{1}{5}(3|1\rangle_A - 4|0\rangle_A)$$

Separates into:

$$\frac{3}{25}(3|0\rangle_B - 4|1\rangle_B)$$ and $$\frac{-4}{25}(3|1\rangle_B - 4|0\rangle_B)$$ which equals $$\frac{25}{25}|0\rangle_B - \frac{24}{25}|1\rangle_B$$

So the resulting state of summing the results of the basis transformations (and dividing by 2) is the constant:

$$|0\rangle_B$$

Qubit B's effect on qubit A
The basis vectors that we've chosen, represented by Hadamard basis vectors are: $$\{\frac{1}{5\sqrt{2}}(7|+\rangle - |-\rangle), \frac{-1}{5\sqrt{2}}(|+\rangle + 7|-\rangle)\}$$

$$\frac{1}{5\sqrt{2}}(7|+\rangle_B - |-\rangle_B)$$

Separates into:

$$\frac{7}{50}(7|+\rangle_A - |-\rangle_A)$$ and $$\frac{-1}{50}(7|-\rangle_A - |+\rangle_A)$$ which equals $$\frac{50}{50}|+\rangle_A - \frac{14}{50}|-\rangle_A$$

The other basis vector:

$$\frac{-1}{5\sqrt{2}}(|+\rangle_B + 7|-\rangle_B)$$

Separates into:

$$\frac{1}{50}(|+\rangle_A + 7|-\rangle_A)$$ and $$\frac{7}{50}(|-\rangle_A + 7|+\rangle_A)$$ which equals $$\frac{50}{50}|+\rangle_A + \frac{14}{50}|-\rangle_A$$

So the resulting state of summing the results of the basis transformations (and dividing by 2) is the constant:

$$|+\rangle_A$$

Bell basis
The four Bell states form a Bell basis. A perfect correlation between any two bases on the individual qubits can be described as a sum of Bell states. For example, $$\frac{1}{\sqrt{2}}(|0+\rangle + |1-\rangle)$$ is maximally entangled but not a Bell state; it represents a correlation between the bases $$b_1$$ and $$b_2 = H.b_1$$. It can be rewritten as $$\frac{1}{\sqrt{2}}(|\Phi^-\rangle + |\Psi^+\rangle)$$ using Bell basis states.

Fix issue
The overlap expression $$\langle\phi\mid\psi\rangle$$ is typically interpreted as the probability amplitude for the state $\psi$ to collapse into the state $\phi$.