PennyLane
Next

To attempt this challenge, please switch to a larger screen size.

Advanced
Quantum Information

An Itch to Switch

Challenge Statement

This challenge is included in the QHack 2023 Flashback Badge Challenge event.

Did you know that there is no way for us to clone a quantum state? The no-cloning theorem states that there is no gate U such that

U\lvert \psi \rangle \lvert 0 \rangle = \lvert \psi \rangle \lvert \psi \rangle

for all states \lvert \psi \rangle. However, if we only work with basis states \lvert j \rangle, there exist operations such that

\lvert j \rangle \lvert 0 \rangle \mapsto \lvert j \rangle \lvert j \rangle.

Zenda and Reece are each in possession of one basis state, which we denote \lvert j\rangle_{Z_0} and \lvert k \rangle_{R_0} respectively. Their PhD supervisor, Dr. Trine, tells them to send each other their basis state without losing their own. "If basis states can be cloned, then surely we can do this", claims Zenda confidently. "Just give us two qubits in the \lvert 0 \rangle state to each of us and we're good to go."

Trine thinks about this... "It's too easy if I allow you to do whatever you want"—she concludes. "Let's make it more fun. I'll give you each one qubit from a Bell state

\vert \Phi\rangle_{Z_1R_1} = \frac{1}{\sqrt{2}}\left(\vert 0\rangle_{Z_1} \vert 0\rangle_{R_1} + \vert 1\rangle_{Z_1} \vert 1\rangle_{R_1}\right) .

"Then you'll have to send your qubit to each other by acting only on the qubits in your possession."

Zenda and Reece try and try, but it seems like a futile task. "We need more resources—mumbles Reece. "Mmm... disappointing" says Trine. "Then, I'll allow you to use a magic gate between your initially entangled qubits, but figure it out fast!"

In this challenge, you will help Zenda and Reece figure out a quantum circuit that performs the operation

\lvert j \rangle_{Z_0} \lvert{\Phi}\rangle_{Z_1R_1} \lvert k \rangle_{R_0} \mapsto \lvert j \rangle_{Z_0} \lvert k \rangle_{Z_1} \lvert j \rangle_{R_1} \lvert k \rangle_{R_0}

with the constraints imposed by Trine. This means that the circuit must be of the form shown in the image below.

Exchanging qubits

In the above, Z is the operator Zenda applies on her qubits, R is the operator Reece applies on his qubits, and M is the magic operator provided by Trine.

Challenge code

In the code below, you are given a number of functions:

  • zenda_operator: Quantum function corresponding to the operator to be applied by Zenda on her qubits. You must complete this function.
  • reece_operator: Quantum function corresponding to the operator to be applied by Reece on his qubits. You must complete this function.
  • magic_operator: The magic operator provided by Trine to be applied on the initially entangled qubits Z_1 and R_1. You must complete this function.

Inputs and outputs

There are no inputs nor outputs for this challenge. You answer will be judged based on the fact that your circuit produces the correct final state for any combination of basis states \lvert j \rangle_{Z_0} and \lvert k \rangle_{R_0}. This will be verified in the check function.

Loading...