Challenge C3

Increment
You need to login to be able to submit solutions!

Implement an operation on a register of n qubits that increments the number written in the register modulo 2^n.

Your operation should take an array of qubits that encodes an unsigned integer in little-endian format, with the least significant bit written first (corresponding to the array element with index 0).

The Solve operation should take the input register and change it without measuring it in order to keep the quantum state, but increment the values its state represents.

For example:

1/2(|0001⟩ + |0010⟩ + |0100⟩ + |1000⟩) should be incremented to 1/2(|1001⟩ + |1010⟩ + |1100⟩ + |0100)

The solve operation should have the following signature:

An unhandled error has occurred. Reload 🗙