# Can quantum and classical circuits be combined in one?

In the standard "entanglement circuit" shown below,

A Hadamard gate can be implemented as a 45-degree-angled polarizer, which will randomize the top |0> into an equal superposition state of |0> and |1> on the same basis.

After the top electron spin / photon polarization is randomized, can the controlled-not (CNOT) gate following it be implemented classically, and still produce an entangled pair of particles?

Classically, the CNOT gate will first measure the state of the first particle, then flip / not flip the second particle to match the state of the first particle.

The immediate output is indeed a perfectly correlated result between the top and bottom particles' states.

Is this quantum-classical circuit implementation testably different from an entangled state?

A Hadamard gate ... will randomize the top |0> into an equal superposition state of |0> and |1> on the same basis.

There is nothing really "random" about the state of the first qubit after the Hadamard gate. It is in a superposition of $$|0\rangle$$ and $$|1\rangle$$ states with equal magnitudes. If we know the state of the first qubit before the Hadamard gate then its state after the gate is completely determined (up to an arbitrary phase angle).

Classically, the CNOT gate will first measure the state of the first particle, then flip / not flip the second particle to match the state of the first particle.

What you are describing is a classical XOR gate. But note that in a quantum CNOT gate there is no measurement of the first qubit. Its state after the CNOT gate is the same as its state before the gate - it is not collapsed into a pure $$|0\rangle$$ or $$|1\rangle$$ state. So it is not clear to me how you propose to implement a classical XOR gate when one of its inputs is not in a pure state.

In general, trying to find classical analogues of quantum computing operations is usually a bad idea as it almost always causes confusion.

• thank you. quantum implementation of hadamard, cnot gates etc, seem to involve "bouncing microwaves on the qubits" (quantumcomputing.stackexchange.com/questions/14576/…) in some fashion... How are we sure this controlled manipulation will also not constitute measurement and (unknown to us) collapse the superposition of the qubits? Dec 4, 2022 at 10:35
• @James The best place to ask this and similar questions is the Quantum Computing stack exchange at quantumcomputing.stackexchange.com. Dec 4, 2022 at 10:54
• @James You don't want to measure at all while you run a quantum circuit. Dec 4, 2022 at 12:31
• @James "Could we do a quantum CNOT without measuring anything?" -- That's exactly the point. Of course, then no-one knows what happened, but again, that's exactly the point. Maybe it is easier to think of this in terms of photons, e.g. when you encode the first bit in polarization, and the second bit in two different paths. Then, a polarizing beam splitter does exactly the job. Dec 4, 2022 at 13:39
• @James Sure, inhomogenous magnetic fields (-> Stern-Gerlach). Dec 4, 2022 at 15:56

The quantum gates are preserving the purity of the state. Thus, they can be represented as the unitary matrices acting on the state vectors, $$$$|\psi_0\rangle \longmapsto |\psi\rangle=U|\psi_0\rangle,$$$$ Or equivalently, on the density matrix, $$$$\rho_0=|\psi_0\rangle\langle\psi_0|\longmapsto \rho_{Q}=U\rho_0 U^\dagger=|\psi\rangle\langle\psi|$$$$

For the quantum CNOT gate in $$\{|00\rangle,|01\rangle,|10\rangle,|11\rangle\}$$ basis, $$$$U=\begin{pmatrix}1&0&0&0\\0&1&0&0\\0&0&0&1\\0&0&1&0\end{pmatrix}$$$$ The state after the Hadamard gate is, $$$$\psi_0=\frac{1}{\sqrt{2}}|00\rangle+\frac{1}{\sqrt{2}}|10\rangle,$$$$ which corresponds to the density matrix, $$$$\rho_0=\begin{pmatrix}\frac{1}{2}&0&\frac{1}{2}&0\\0&0&0&0\\\frac{1}{2}&0&\frac{1}{2}&0\\0&0&0&0\end{pmatrix}$$$$

After the CNOT gate, $$$$|\psi\rangle=\frac{1}{\sqrt{2}}|00\rangle+\frac{1}{\sqrt{2}}|11\rangle$$$$ that corresponds to the density matrix, $$$$\rho_Q=\begin{pmatrix}\frac{1}{2}&0&0&\frac{1}{2}\\0&0&0&0\\0&0&0&0\\\frac{1}{2}&0&0&\frac{1}{2}\end{pmatrix}$$$$

However when you replace one of the gates with the classical one the final state becomes mixed. I.e. you can no longer describe it using the state vector, but only by means of the density matrix formalism. Then the transformation of the density matrix is a combination of the projection operators (measurements) and the post-projection unitary operations, $$$$\rho_0\longmapsto \rho_C=U_{\sigma_1=0}P_{\sigma_1=0}\rho_0 P_{\sigma_1=0}U_{\sigma_1=0}^\dagger+U_{\sigma_1=1}P_{\sigma_1=1}\rho_0 P_{\sigma_1=1}U_{\sigma_1=1}^\dagger$$$$ I.e. we first measure the state, then rotate it depending on the result.

In our case we can represent them as, $$$$P_{\sigma_1=0}=\begin{pmatrix}1&0&0&0\\0&1&0&0\\0&0&0&0\\0&0&0&0\end{pmatrix}, P_{\sigma_1=1}=\begin{pmatrix}0&0&0&0\\0&0&0&0\\0&0&1&0\\0&0&0&1\end{pmatrix}$$$$ and we may take $$U_{\sigma_1=0}=U_{\sigma_1=1}=U$$.

Then the resulting density matrix is different from $$\rho_Q$$, $$$$\rho_C=\begin{pmatrix}\frac{1}{2}&0&0&0\\0&0&0&0\\0&0&0&0\\0&0&0&\frac{1}{2}\end{pmatrix}$$$$ where the lack of the off-diagonal elements signifies the destruction of the superposition, therefore of the entanglement. Basically it may be interpreted as $$|00\rangle$$ with 1/2 probability and $$|11\rangle$$ with 1/2 probability but in the classical sense. There is a correlation but not entanglement.

You may distinguish these two states if you measure not just $$\sigma_z$$ for both qubits, but e.g. $$\sigma_z$$ for the first one and $$\sigma_x$$ for the second one. Of course acting on them with extra gates will also produce different results.

• it is a great answer! thank you. Dec 4, 2022 at 11:27
• does the 45-degree-angled polarizer by itself faithfully implement the quantum Hadamard gate's properties? Dec 4, 2022 at 11:35
• @James The polarizer is usually understood as a filter blocking one polarization and transmitting another. This would act as a projector, not as the Hadamard gate. Though if you start with $|0\rangle$ state you may produce the desired $\frac{1}{\sqrt{2}}(|0\rangle+|1\rangle)$ half of time. If we talk about photons, to produce the Hadamard gate you may use half waveplate.
– OON
Dec 4, 2022 at 13:13