The Weighting Pre‐processing

We use the function get_state from the lesson Visual Exploration of the Qubit State. It takes the angle theta and returns a valid quantum state. An angle of 00 denotes the state 0|0\rangle, which is the probability of 100%100\% measuring 0. An π\pi denotes the state 1|1\rangle, the probability of 100%100\% measuring 1.

Accordingly, we multiply the overall probability we calculate at line 14 with pi to specify an angle up to π\pi in line 17. Since the correlation coefficients are between -1 and 1 and most of our coefficients are negative, a value of μ\mu towards -1 implies that the passenger died. Thus, we reverse the angles by calculating (1-mu)*pi.

Get hands-on with 1200+ tech skills courses.