Implementing an upside-down coin toss
In this recipe, we will tweak our very first quantum program a little bit but still keep it relatively simple. An actual coin can be tossed starting with either heads or tails facing upward. Let's do another quantum coin toss but with a different starting point, the coin facing tails up. In Dirac notation, we start with our qubit in instead of in .
Getting ready
The sample code for this recipe can be found here: https://github.com/PacktPublishing/Quantum-Computing-in-Practice-with-Qiskit-and-IBM-Quantum-Experience/blob/master/Chapter04/ch4_r3_coin_toss_tails.py.
Just like the previous recipe, this one is almost identical to the first coin toss recipe. Feel free to reuse what you have already created. The only real difference is that we add a new quantum gate, the X (or NOT) gate.
How to do it...
The following steps are to a large extent identical to the steps from the Quantum coin toss revisited recipe. There are, however,...