Calculating the Posterior Probability
Learn how we can calculate the posterior probability.
We'll cover the following...
We'll cover the following...
We use the controlled -gate to calculate the posterior probability.
Calculating the posterior probability for a modifier smaller than 1.0
If the modifier is below in the code block after line 6, we need to reduce the target probability by a portion of in line 8. The target qubit acts as the control qubit. In states when the target qubit is 1, we separate a part of 1−modifier and set the controlled qubit to 1. The controlled qubit has the index step*2. The for step is 0, and the index of this qubit is 0, too. This qubit acts as a trunk. We do not work with it anymore.
The controlled rotation does not change the value of the control qubit. Thus, the target-qubit is 1 in both parts. The following CNOT-gate in ...