Research Article

Integration of a Quantum Voting Scheme into Grayscale Images Using the Novel Enhanced Quantum Representation and Qiskit Framework

Figure 5

The NEQR representation of gray value 137 (the pixel in the upper-left corner of Alice’s image, where the last bit was set to “1,” changing the value from 136 to 137). The binary representation of 137 is 100010012, where the first bit (to the left) represents the MSB, corresponding to , and the last one (to the right)—the LSB, corresponding to ; the classical binary representation of the pixel gray value should be seen in relation to qubits . The LSB of the pixel is represented by qubit , and its state is set to (the first bit from the binary representation of 102, Alice’s vote). The auxiliary qubit anc4 is set to state only after the position qubits are in the desired state; here, for the first pixel, the desired states are all initially , since the target pixel is at coordinates (0, 0), so a round of NOT gates on all position qubits is required. The last three CNOT gates configure the states for the corresponding gray value qubits, , , and , thus ensuring the state matches level 137. The purpose of the final layer of NOT gates is to allow another potential NEQR representation of a new gray value for a different pixel after this one (they must be set to cancel the NOT gates in the beginning). On the right, in the histogram that illustrates the result of the quantum measurement, we can see that the gray level qubits are only set to their desired states when the anc4 qubit is in state .