Problem G3

Statement
Copy Copied
Description:
Implement a quantum oracle on $$$N$$$ qubits which checks whether the vector $$$\vec{x}$$$ is a palindrome (i.e., implements the function $$$f(\vec{x}) = 1$$$ if $$$\vec{x}$$$ is a palindrome, and 0 otherwise).

You have to implement an operation which takes the following inputs:

- an array of $$$N$$$ ($$$1 \le N \le 8$$$) qubits $$$x$$$ in an arbitrary state (input register),
- a qubit $$$y$$$ in an arbitrary state (output qubit),

and performs a transformation $$$|x\rangle|y\rangle \rightarrow |x\rangle|y \oplus f(x)\rangle$$$. The operation doesn't have an output; its "output" is the state in which it leaves the qubits.

Your code should have the following signature:

Input Format:
None

Output Format:
None

Note:
None