A2: Generate State 12(03)\frac{1}{\sqrt{2}}\lparen\ket{0}-\ket{3}\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 quantum state ψ\ket{\psi} is defined as

ψ=12(0011).\begin{equation} \ket{\psi} = \frac{1}{\sqrt{2}} (\ket{00} - \ket{11}) \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.