added todo

This commit is contained in:
Daniel Tsvetkov 2020-02-04 17:48:32 +01:00
parent 5d43e985cb
commit 14bee6764a

View File

@ -1153,24 +1153,22 @@ def test_quantum_processor():
def test_light(): def test_light():
global UNIVERSE_STATES # TODO: Are these measurement operators the correct way to represent hor/ver/diag filter?
UNIVERSE_STATES = [] hor_filter = MeasurementOperator.create_from_prob(Matrix(_0.m), name='h')
hor = s('|0>', name='') diag_filter = MeasurementOperator.create_from_prob(Matrix(_p.m), name='d')
ver = s('|1>', name='') ver_filter = MeasurementOperator.create_from_prob(Matrix(_1.m), name='v')
diag1 = hor + ver
diag1.name = '🡕'
hor_filter = MeasurementOperator.create_from_prob(Matrix(hor.m), name='h')
diag_filter = MeasurementOperator.create_from_prob(Matrix(diag1.m), name='d')
ver_filter = MeasurementOperator.create_from_prob(Matrix(ver.m), name='v')
for i in range(10): # create random light/photon
random_pol = [[np.random.uniform(0, 1)], [np.random.uniform(0, 1)]] random_pol = [[np.random.uniform(0, 1)], [np.random.uniform(0, 1)]]
random_light = State(normalize_state(random_pol)) random_light = State(normalize_state(random_pol))
qc = QuantumCircuit(1, initial_steps=[[random_light]]) qc = QuantumCircuit(1, initial_steps=[[random_light]])
# add three filters as operators
qc.add_row([hor_filter, diag_filter, ver_filter]) qc.add_row([hor_filter, diag_filter, ver_filter])
qc.print() qc.print()
qp = QuantumProcessor(qc) qp = QuantumProcessor(qc)
# TODO: Dealing with non-normalized state vectors # TODO: This doesn't work - dealing with non-normalized state vectors
# - When measured in horizontal filter, the state vector has a positive |0> and 0 for |1>
qp.print_sample(qp.get_sample(100)) qp.print_sample(qp.get_sample(100))