# Trap Code for Quantum Authentication

The Trap Code is a non-interactive scheme for quantum authentication. It appends two additional trap registers in a fixed state, on which a Pauli twirl or a permutation is acted on. It furthermore makes use of error correction codes for encoding the quantum message.

## Outline

The trap code requires a shared pair of secret classical keys. It makes use of an error correction code to encode the quantum message. Consequently, two so-called trap registers in the fixed states ${\displaystyle |0\rangle \langle 0|}$ and ${\displaystyle |+\rangle \langle +|}$ are appended. The total register is then encrypted by applying a permutation and a Pauli twirl, each according to the classical keys. The receiver then applies the inverse Pauli twirl and permutation and consequently measures the two trap registers in the computational or Hadamard basis respectively to decide whether to accept or abort the process.

## Assumptions

• The sender and receiver share a secret classical pair of keys
• The sender and receiver have agreed on an ${\displaystyle [[n,k,d]]}$ error correction code

## Notation

• ${\displaystyle {\mathcal {S}}}$: suppliant (sender)
• ${\displaystyle {\mathcal {A}}}$: authenticator (prover)
• ${\displaystyle \rho }$: 1-qubit input state
• ${\displaystyle [[n,k,d]]}$: an error correction code that corrects up ${\displaystyle t}$ errors errors by encoding ${\displaystyle k}$ logical qubits in ${\displaystyle n}$ physical qubits, where ${\displaystyle d=2t+1}$
• ${\displaystyle \{\pi _{i}\}}$: a set of permutations indexed by ${\displaystyle i}$
• ${\displaystyle \{P_{i}\}}$: a set of Pauli operations indexed by ${\displaystyle i}$

## Protocol Description

Input: ${\displaystyle \rho }$, pair of secret classical keys ${\displaystyle k=(k_{1},k_{2})}$

Output: Quantum state ${\displaystyle \rho ^{\prime }}$ if the protocol accepts; fixed quantum state ${\displaystyle \Omega }$ if the protocol aborts

• Encoding:
1. ${\displaystyle {\mathcal {S}}}$ applies an ${\displaystyle [[n,1,d]]}$ error correction code
2. ${\displaystyle {\mathcal {S}}}$ appends an additional trap register of ${\displaystyle n}$ qubits in state ${\displaystyle |0\rangle \langle 0|^{\otimes n}}$
3. ${\displaystyle {\mathcal {S}}}$ appends a second additional trap register of ${\displaystyle n}$ qubits in state ${\displaystyle |+\rangle \langle +|^{\otimes n}}$
4. ${\displaystyle {\mathcal {S}}}$ permutes the total ${\displaystyle 3n}$-qubit register by ${\displaystyle \pi _{k_{1}}}$ according to the key ${\displaystyle k_{1}}$
5. ${\displaystyle {\mathcal {S}}}$ applies a Pauli encryption ${\displaystyle P_{k_{2}}}$ according to key ${\displaystyle k_{2}}$
• Mathematical Encoding Description:
Mathematically, the encoding process is given by
${\displaystyle {\mathcal {E}}_{k}:\rho \mapsto P_{k_{2}}\pi _{k_{1}}\left({\text{Enc}}(\rho )\otimes |0\rangle \langle 0|^{\otimes n}\otimes |+\rangle \langle +|^{\otimes n}\right)\pi _{k_{1}}^{\dagger }P_{k_{2}}.}$
In the above, ${\displaystyle {\text{Enc}}(\rho )}$ denotes the quantum message ${\displaystyle \rho }$ after applying the error correction code for encoding (see step 1).
• Decoding:
1. ${\displaystyle {\mathcal {A}}}$ applies ${\displaystyle P_{k_{2}}}$ according to key ${\displaystyle k_{2}}$
2. ${\displaystyle {\mathcal {A}}}$ applies inverse permutation ${\displaystyle \pi _{k_{1}}^{\dagger }}$ according to the key ${\displaystyle k_{1}}$
3. ${\displaystyle {\mathcal {A}}}$ measures the last ${\displaystyle n}$ qubits in the Hadamard basis ${\displaystyle \{|+\rangle ,|-\rangle \}}$
4. ${\displaystyle {\mathcal {A}}}$ measures the second last ${\displaystyle n}$ qubits in the computational basis ${\displaystyle \{|0\rangle ,|1\rangle \}}$

a. If the two measurements in step 3 and 4 result in ${\displaystyle |+\rangle \langle +|}$ and ${\displaystyle |0\rangle \langle 0|}$, an additional flag qubit in state ${\displaystyle |\mathrm {ACC} \rangle \langle \mathrm {ACC} |}$ is appended and the quantum message is decoded according to the error correction code
b. Otherwise, an additional flag qubit in state ${\displaystyle |\mathrm {REJ} \rangle \langle \mathrm {REJ} |}$ is appended and the (disturbed) encoded quantum message is replaced by a fixed state ${\displaystyle \Omega }$
• Mathematical Decoding Description:
Mathematically, the decoding process is given by
${\displaystyle {\mathcal {D}}_{k}:\rho ^{\prime }\mapsto {\text{Dec }}\mathrm {tr} _{0,+}\left({\mathcal {P}}_{\text{acc}}\pi _{k_{1}}^{\dagger }P_{k_{2}}(\rho ^{\prime })P_{k_{2}}\pi _{k_{1}}{\mathcal {P}}_{\text{acc}}^{\dagger }\right)\otimes |\mathrm {acc} \rangle \langle \mathrm {acc} |+\mathrm {tr} _{0,+}\left({\mathcal {P}}_{\text{rej}}\pi _{k_{1}}^{\dagger }P_{k_{2}}(\rho ^{\prime })P_{k_{2}}\pi _{k_{1}}{\mathcal {P}}_{\text{acc}}^{\dagger }\right)\Omega \otimes |{\text{rej}}\rangle \langle {\text{rej}}|.}$
In the above, ${\displaystyle {\text{Dec}}}$ refers to decoding of the error correction code (see step 4a) and ${\displaystyle \mathrm {tr} _{0,+}}$ denotes the trace over the two trap registers. Moreover, ${\displaystyle {\mathcal {P}}_{\text{acc}}}$ and ${\displaystyle {\mathcal {P}}_{\text{rej}}}$ refer to the measurement projectors that determine whether the protocol accepts or aborts the received quantum message. It is
${\displaystyle {\mathcal {P}}_{\text{acc}}=I^{\otimes n}\otimes |0\rangle \langle 0|^{\otimes n}\otimes |+\rangle \langle +|,}$
and
${\displaystyle {\mathcal {P}}_{\text{rej}}=I^{\otimes 3n}-{\mathcal {P}}_{\text{acc}}.}$

## References

Contributed by Isabel Nha Minh Le and Shraddha Singh