The submitted code must follow the specified format:
from qiskit import QuantumCircuitdef solve(n: int) -> QuantumCircuit: qc = QuantumCircuit(n) # Write your code here: return qc
Sample Input
n=2:
The matrix A is calculated as follows.
A=2∣00⟩⟨00∣−I=10000−10000−10000−1
Hints
Open
An n-qubit quantum state ∣ψ⟩ can be represented as a column vector of size 2n, just like a 1-qubit quantum state, and the adjoint ⟨ψ∣, inner product ⟨ϕ∣ψ⟩, and outer product ∣ψ⟩⟨ϕ∣ can also be defined in the same way.