You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For one use case it is beneficial to know in the output whether the final quantum state is deterministic.
This is a hard problem but the simulator can output a new key "guaranteed_deterministic_state" with possible values True or False. In the first case, the state is deterministic. In the second, it is not known ("maybe").
More generally the simulator, when asked N iterations on a provably deterministic circuit, should not compute the final state N times, but just once. This is a major optimization that applies to a lot of cases. Going further, when a circuit only contains final measurements (therefore outputting a non-deterministic state), the simulator also should compute the pre-measurement state a single time.
Examples
h q[0]
measure q[0]
results in "guaranteed_deterministic_state": False.
h q[0]
results in "guaranteed_deterministic_state": True.
x q[0]
measure q[0]
cond(b[0]) x q[1]
results in "guaranteed_deterministic_state": False even though the circuit is perfectly deterministic. A more advanced implementation (detailed below) can here return "guaranteed_deterministic_state": True as it would know that the measure q[0] is in fact deterministic since q[0] is not in superposition beforehand.
Implementation ideas
For conditional gates we need to know whether a classical bit is non-deterministic.
The simulator can maintain a boolean flag for each measurement register bit, that tells whether a bit is "deterministic" so far (True at the start).
The state becomes "maybe non-deterministic" as soon as:
a qubit in superposition is measured/prepped (this sets the associated bit to "non-deterministic")
a conditional gate is performed based on a non-deterministic bit
When asked N iterations, the simulator can compute the state/measurement register once as long as it's deterministic. Then iterate N times the rest of the circuit by resetting the state/measurement register to its last deterministic value between each iteration.
The text was updated successfully, but these errors were encountered:
My suggestion would be to allow for a flag to prevent optimization. This would mean that the default behaviour is to optimize if possible. However, if the user really doesn't want to, we should be able to prevent it.
For one use case it is beneficial to know in the output whether the final quantum state is deterministic.
This is a hard problem but the simulator can output a new key "guaranteed_deterministic_state" with possible values True or False. In the first case, the state is deterministic. In the second, it is not known ("maybe").
More generally the simulator, when asked N iterations on a provably deterministic circuit, should not compute the final state N times, but just once. This is a major optimization that applies to a lot of cases. Going further, when a circuit only contains final measurements (therefore outputting a non-deterministic state), the simulator also should compute the pre-measurement state a single time.
Examples
results in
"guaranteed_deterministic_state": False
.results in
"guaranteed_deterministic_state": True
.results in
"guaranteed_deterministic_state": False
even though the circuit is perfectly deterministic. A more advanced implementation (detailed below) can here return"guaranteed_deterministic_state": True
as it would know that themeasure q[0]
is in fact deterministic sinceq[0]
is not in superposition beforehand.Implementation ideas
For conditional gates we need to know whether a classical bit is non-deterministic.
The simulator can maintain a boolean flag for each measurement register bit, that tells whether a bit is "deterministic" so far (True at the start).
The state becomes "maybe non-deterministic" as soon as:
When asked N iterations, the simulator can compute the state/measurement register once as long as it's deterministic. Then iterate N times the rest of the circuit by resetting the state/measurement register to its last deterministic value between each iteration.
The text was updated successfully, but these errors were encountered: