# Gate definitions for quantum random access codes

I would like to know how the gates are defined in quantum random access codes? Consider the $$2 \to 1$$ code described in Lemma 3.1 of this paper.

The section defines the encoding and decoding circuits. But it is not clear to me how to define gates. Say, I want to apply an $$Rz(\theta)$$ on the first qubit or a CNOT gate on both qubits.

I was able to make some progress. For single qubit gates, applying it directly means applying on the first encoded qubit. To apply it on the second qubit, you have to conjugate it with the H gate. I am still not sure how to apply the CNOT gate.

• Notice that these codes encode classical bits into qubits, so applying quantum gates to the encoded bits is not necessarily meaningful. Moreover, the encoding is not linear (there is a nontrivial normalization factor), so that a CNOT gate on the encoded bits might not correspond to a linear operator (i.e., gate) on the encoding qubit. – smapers Aug 24 '20 at 6:48
• @smapers, since $BPP \subseteq BQP$, shouldn't it be always meaningful to apply quantum gates to encoded classical bits? – Omar Shehab Aug 24 '20 at 15:47
• No, that is a statement about randomized vs quantum algorithms, unrelated to the study of encoding. – smapers Aug 24 '20 at 18:10
• @smapers, let's say I want to adopt QRAC for Grover's algorithm. Now I need to be able to apply CNOT, right? – Omar Shehab Aug 24 '20 at 23:21
• That's not quite how this works. The encoding is really not defined for qubits (e.g., the encoded state would depend on the global phase, which is not physical), hence it makes no sense to run Grover's algorithm on the classical input bits. – smapers Aug 25 '20 at 9:25