From 1b7c3a6cdc9126f6c4c376460b7207f8afdf220c Mon Sep 17 00:00:00 2001 From: Daniel Tsvetkov Date: Sat, 28 Mar 2020 10:26:11 +0100 Subject: [PATCH] should we measure in Bell frst? --- 10_krisi_3qubits_game.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/10_krisi_3qubits_game.py b/10_krisi_3qubits_game.py index 03b48ad..2a918c9 100644 --- a/10_krisi_3qubits_game.py +++ b/10_krisi_3qubits_game.py @@ -107,10 +107,24 @@ def test_krisi_measurement_3(): q1 = State.from_bloch_angles(theta1, phi1) q2 = State.from_bloch_angles(theta2, phi2) - # Measure in the arbitrary basis - st = State(q0 * q1 * q2) - meas = st.measure(basis=basis) + # TODO: This part measures the first two qubits in Bell basis, then: + # 1. constructs a new pure state + # (e.g. if result was 11, constructs |11>) + # 2. Combines this new pure state with the third qubit + MEASURE_FIRST_BELL = False + if MEASURE_FIRST_BELL: + # Measure in the Bell's basis + st = State(q0 * q1) + meas = st.measure(basis=[b_phi_p, b_phi_m, b_psi_p, b_psi_m]) + new_st = s("|" + meas + ">") + st = State(new_st * q2) + else: + # TODO: -OR- alternatively - measure all three without measuring in + # Bell first + st = State(q0 * q1 * q2) + # Measure in the 8D basis + meas = st.measure(basis=basis) return meas def krisi_3_format_results(results):