B1: Generate State eiθ0e^{i\theta}\ket{0}

Time Limit: 3 sec

Memory Limit: 512 MiB

Score: 100

Problem Statement

You are given a real number θ\theta.
Implement the operation of preparing the state ψ\ket{\psi} from the zero state on a quantum circuit qc\mathrm{qc} with 11 qubit.
The quantum state ψ\ket{\psi} is defined as

ψ=eiθ0.\begin{equation} \ket{\psi} = e^{i\theta}\ket{0} \nonumber \end{equation}.

Constraints

  • 0θ<2π0 \leq \theta < 2\pi
  • In this problem, the state with different global phase will not be considered correct.
  • The submitted code must follow the specified format:
from qiskit import QuantumCircuit
 
 
def solve(theta: float) -> QuantumCircuit:
    qc = QuantumCircuit(1)
    # Write your code here:
 
    return qc

Please sign in to submit your answer.