The first one I want to prove is measurement will collapse the qubit. I will use the AssertProb to verify the value with probability. The pseudo code is listed below:
- use H gate to set the qubit to superposition
- check the probability to 1 equals 0.5 (50%)
- measure the qubit
- check the qubit equals the measured value equals to 1 (100%). The qubit collapsed.
the code listed below: