Problem Statement
Implement the operation of preparing the state ∣ψ⟩ from the zero state on a quantum circuit qc with 2 qubits.
The state ∣ψ⟩ is defined as
∣ψ⟩=31(∣0⟩+∣1⟩+∣2⟩)=31(∣00⟩+∣10⟩+∣01⟩).
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
Hints
Open
- You can import the
math library if necessary.
Please refer to the Q&A for available libraries.
import math