Open ellishg opened 5 years ago
After talking with Will we realized that this method works well except in the case when the desired branch is very unlikely. When that happens the tomography will take a long time since it has to try many times before it finds the right outcome. If the probability we take a branch is p
, then the expected number of trials is 1/p
. If we know p
, maybe we can use this to determine if this is a good idea.
I had an idea for a feature that might be useful. Since we are already building the control flow graph, we can display it to the user and ask them to specify a path by listing the order of the basic blocks to execute. We can then change the program to be (almost) linear and the wavefunction should be a pure state. We won't be able to get rid of measurements and so if the measurement gives the wrong outcome we need to restart the program.
Here's an example.
If the user wants to ignore the if statement, we can change this to