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).
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).