I discovered a bug in my Quantum True Random Number Generator. It has been fixed and updated on GitHub.

During troubleshooting, I thought the problem was that I couldn’t request a specific quantum computer. The simulator worked and — unless I was somehow mistaken at the time — requesting a random machine worked. Therefore, I thought I had correctly isolated the code that was generating errors.

While working with new code, however, I could no longer request a random machine. The simulator still worked, but no real hardware seemed to be working.

So, I went back to this project’s code and tried again. Requesting a random machine no longer worked. This is why I now think I might’ve been mistaken the first time.

“I’m never wrong. I once thought I was wrong, but I was mistaken.” – Bobby “The Brain” Heenan

Armed with two sets of code, I isolated the problem at the execute command. It turns out that the simulator is far more forgiving than real hardware.

Somewhere I had found code that suggested using memory=True within the execute statement, as well as using get_memory instead of get_counts. After I removed memory=True and changed get_memory to get_counts, everything suddenly worked. I could request a specific quantum computer, save the measurements to variables, and work with the results.

Now, onto bigger projects….