-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move all Pauli measurements to the front before Pauli presimulation #209
Move all Pauli measurements to the front before Pauli presimulation #209
Conversation
This commit adds a method "__extract_pauli_nodes" that applies exchange rules to move all Pauli measurements to the front of a pattern. This allows all the Pauli measurements to be presimulated, even if their initial domains depend on other measurements. On random circuits of 10 qubits (depth 10), number of remaining nodes after Pauli presimulation is reduced by a factor of 4 in average, and the time spent on state vector simulation is reduced by a factor 75 (including the time for Pauli presimulation).
Suggested by EarlMilktea: TeamGraphix#209 (comment)
Suggested by EarlMilktea: TeamGraphix#209 (comment)
Suggested by EarlMilktea: TeamGraphix#209 (comment)
Suggested by EarlMilktea: TeamGraphix#209 (comment)
Suggested by EarlMilktea: TeamGraphix#209 (comment)
Suggested by EarlMilktea: TeamGraphix#209 (comment)
graphix/pattern.py
Outdated
else: | ||
new_seq.append(cmd) | ||
if not pauli_nodes_inserted: | ||
new_seq.extend(pauli_nodes.values()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this possible? I guess you need a standardization (I know we do it in measure_pauli
but we should be explicit rather than implicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this might move the comand across possible dependency. please add a line of two of notes about consequences of this skipping or if this doesn't affect at all, then why so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed to a clearer structure in 7483827, providing proofs of the signal shifting: the function extract_pauli_nodes
has been renamed to move_pauli_measurements_to_the_front
and is now responsible for both shifting and moving the Pauli measurements in the sequence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. thank you!
This commit adds a method
__extract_pauli_nodes
that applies exchange rules to move all Pauli measurements to the front of a pattern. This allows all the Pauli measurements to be presimulated, even if their initial domains depend on other measurements.On random circuits of 10 qubits (depth 10), number of remaining nodes after Pauli presimulation is reduced by a factor of 4 on average, and the time spent on state vector simulation is reduced by a factor 75 (including the time for Pauli presimulation).