A2: Generate State 12(10+01)\frac{1}{\sqrt{2}}\lparen\ket{10}+\ket{01}\rparen

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

ψ=12(10+01).\begin{equation} \ket{\psi} = \frac{1}{\sqrt{2}} \lparen \ket{10} + \ket{01} \rparen \nonumber \end{equation}.

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.