Communication

Superdense Coding

Difficulty: Easy ★

Alice and Bob share |Phi+> = (|00> + |11>)/sqrt(2), with Alice holding qubit 0. Alice touches only her own qubit and sends it to Bob, and Bob recovers two classical bits.

Objective

encode_message(message) returns a two-qubit circuit that acts only on qubit 0, for message in {"00", "01", "10", "11"}. decode_message() returns Bob's two-qubit circuit that turns the encoded pair into the basis state |message> (Qiskit label order).

Constraints

  • encode_message may only touch qubit 0.

Entry Point

encode_message

Checks

  • Exports encode_message(message) and decode_message().
  • Alice's encoder only acts on qubit 0.
  • Bob decodes all four messages.

Your Code

Outputpending

Execution results will appear here.