Hello @ming !
I checked your script and it seems that the results are compatible with a 5 qubits problem. However, on this line, the variable most_freq_bit_string
is being formatted as a length-4 binary string by writing :04b
, as Isaac pointed out in a previous post you made:
I think you are getting the impression the result is 4 qubits from here. I would suggest as debug exercise to check out in the decimal form and see if makes sense
Another problem I’ve found in you code is this part:
The number of ticks is not compatible with the range of your results, since you have 2^5 possible binary string outcomes. Try fixing the range of the bar plot to match the dimension of your problem I am sure this will help to better visualize your results.