Problem Statement
Implement an oracle on a -qubit quantum circuit which satisfies the following condition:
The output of for inputs other than and is not specified.
Constraints
- Integers must be encoded by little-endian.
- Global phase is ignored in judge.
- The submitted code must follow the specified format:
from qiskit import QuantumCircuit
def solve() -> QuantumCircuit:
qc = QuantumCircuit(3)
# Write your code here:
return qcHints
Open
- You can apply a multi-controlled gate of a quantum gate as follows:
from qiskit.circuit.library import Gate
qc.append(Gate().control(n - 1), range(n))