Problem Statement
For an integer , define .
Implement an -qubit oracle on a quantum circuit .
The oracle acts on basis states , where and , as follows:
Here, denotes the bitwise XOR operator.
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, QuantumRegister
def solve() -> QuantumCircuit:
x = QuantumRegister(3)
y = QuantumRegister(3)
qc = QuantumCircuit(x, y)
# Write your code here:
return qcHints
Open
- For example, when , we have .