From November 7 to November 28, IBM hosted a quantum challenge that included 5 execises spread over the three week period. This was the solution that I came up with for the third exercise where we were tasked with creating a quantum algorithm to solve any 3x3 board configuration of the famous lights out puzzle.
The approach I took:
- Apply hadamard transform of the flip qubits
- Initialize board state on the tile qubits
- X + H to the oracle qubit
- Connect all flip qubits to tile qubits following the implications of flipping on/off a certain block
- Kicking a negative phase to the board config with all 0 lights
- Kicking that negative phase back up to the flip qubit config that resulted in that all zero config
- Applying the diffusion operator to the flip qubits to amplify probabilities of measuring the solution.
- After enough iterations, measure the solution.