Problem Statement
You are given an integer and real numbers . Implement the operation defined by the following matrix on a quantum circuit with qubits:
where denotes the identity matrix and is defined by
Constraints
- Global phase is ignored in judge.
- The submitted code must follow the specified format:
from qiskit import QuantumCircuit
def solve(n: int, T: list[float]) -> QuantumCircuit:
qc = QuantumCircuit(n)
# Write your code here:
return qc
Hints
Open
- You can apply the inverse gate or the inverse circuit as follows:
qc.compose(sub_qc().inverse(), inplace=True)
# def sub_qc() -> QuantumCircuit