Problem Statement
Implement the oracle on a quantum circuit with qubits acting on computational basis states as
where denotes the XOR operator.
Constraints
- Global phase is ignored in judge.
- The submitted code must follow the specified format:
from qiskit import QuantumCircuit, QuantumRegister
def solve() -> QuantumCircuit:
x, y = QuantumRegister(1), QuantumRegister(1)
qc = QuantumCircuit(x, y)
# Write your code here:
return qc
Sample Input
- : The implemented oracle should perform the following transformation.
Hints
Open
- You can apply the quantum gate to the qubit as follows:
qc.g(x)