A4: Generate state 13(0+1+2))\frac{1}{\sqrt{3}} (\ket{0} + \ket{1} + \ket{2})) I

Time Limit: 3 sec

Memory Limit: 512 MiB

Score: 200

Problem Statement

Implement the operation of preparing the state ψ\ket{\psi} from the zero state on a quantum circuit qc\mathrm{qc} with 22 qubits.

The state ψ\ket{\psi} is defined as

ψ=a00+a11+a22=a000+a110+a201,\begin{equation} \ket{\psi} = a_0\ket{0} + a_1\ket{1} + a_2\ket{2} = a_0\ket{00} + a_1\ket{10} + a_2\ket{01}, \nonumber \end{equation}

where a0a_0, a1a_1, and a2a_2 denote arbitrary non-zero probability amplitudes (any values are permitted).

Constraints

  • Global phase is ignored in judge.
  • The submitted code must follow the specified format:
from qiskit import QuantumCircuit
 
 
def solve() -> QuantumCircuit:
    qc = QuantumCircuit(2)
    # Write your code here:
 
    return qc

Please sign in to submit your answer.