qutip-qip
qutip-qip copied to clipboard
Measurements with time evolution
When using the pulse models to simulate the time evolution a state, if there are measurements being done in a circuit, the execution fails.
Could time evolution account for measurements?
A possible approach could be to collapse a state, on measurement, into a mixture (with appropraite probabilities) of all the measurement outcomes (to get a density matrix). Then continue evolution from that point on the resulting density matrix.
It seems that this should now be possible with the new low-level interface solver.step
. Similar to the discussion in https://github.com/qutip/qutip/issues/1571, we should be able to evaluate the circuit up to a measurement step, perform the measurement and then start the next step until a second measurement occurs.
Another question that remains to be discussed is how we interpret the measurement:
- Do we project the state to one of the measurement results or
- we branch the simulation and keep all possible measurement results.
In the gate-level
QubitCircuit
, we go with the second option by default.