Problem Statement
You are given integers , and .
Implement an oracle satisfying the following transition on a quantum circuit with qubits.
For any pair of integers satisfying and , the oracle satisfies
Constraints
- Global phase is ignored in judge.
- Integers must be encoded by little-endian.
- The submitted code must follow the specified format:
from qiskit import QuantumCircuit, QuantumRegister
def solve(n: int, a: int, L: int) -> QuantumCircuit:
x, y = QuantumRegister(n), QuantumRegister(n + 1)
qc = QuantumCircuit(x, y)
# Write your code here:
return qc
Hints
Open
- You can consider the way to apply the solution of problem B5.
- You can consider the following first, for any pair of integers satisfying and .