should we measure in Bell frst?
This commit is contained in:
parent
3a3b0915a5
commit
1b7c3a6cdc
@ -107,10 +107,24 @@ def test_krisi_measurement_3():
|
|||||||
q1 = State.from_bloch_angles(theta1, phi1)
|
q1 = State.from_bloch_angles(theta1, phi1)
|
||||||
q2 = State.from_bloch_angles(theta2, phi2)
|
q2 = State.from_bloch_angles(theta2, phi2)
|
||||||
|
|
||||||
# Measure in the arbitrary basis
|
# TODO: This part measures the first two qubits in Bell basis, then:
|
||||||
st = State(q0 * q1 * q2)
|
# 1. constructs a new pure state
|
||||||
meas = st.measure(basis=basis)
|
# (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
|
return meas
|
||||||
|
|
||||||
def krisi_3_format_results(results):
|
def krisi_3_format_results(results):
|
||||||
|
Loading…
Reference in New Issue
Block a user