![]() |
The Quantum Exact Simulation Toolkit v4.3.0
|
Functions for modifying existing Pauli data structures. More...
Functions | |
| void | sortPauliStrSumLexicographic (PauliStrSum sum) |
| void | sortPauliStrSumMagnitude (PauliStrSum sum) |
Functions for modifying existing Pauli data structures.
| void sortPauliStrSumLexicographic | ( | PauliStrSum | sum | ) |
Reorders the terms within a sum of weighted Pauli strings so that the Pauli strings are ordered lexicographically.
Let \( H = \) sum, satisfying
\[ H = \sum\limits_j c_j \, \hat{\sigma}_j \]
where \( c_j \) is the coefficient of the \( j \)-th PauliStr \( \hat{\sigma}_j \).
This function applies the permutation \( \pi \) to \( H \), whereby
\[ H = \sum\limits_j c_{\pi(j)} \, \hat{\sigma}_{\pi(j)} \]
such that
\[ \hat{\sigma}_{\pi(i)} <_{lex} \hat{\sigma}_{\pi(j)} \ \forall \ \pi(i) < \pi(j). \]
| [in,out] | sum | a weighted sum of Pauli strings to reorder. |
| error |
|
Definition at line 310 of file paulis.cpp.
| void sortPauliStrSumMagnitude | ( | PauliStrSum | sum | ) |
Reorders the terms within a sum of weighted Pauli strings such that coefficients are ordered with decreasing magnitude.
Let \( H = \) sum, satisfying
\[ H = \sum\limits_j c_j \, \hat{\sigma}_j \]
where \( c_j \) is the coefficient of the \( j \)-th PauliStr \( \hat{\sigma}_j \).
This function applies the permutation \( \pi \) to \( H \) such that
\[ |c_{\pi(i)}| > |c_{\pi(j)}| \, \forall \, \pi(i) < \pi(j). \]
| [in,out] | sum | a weighted sum of Pauli strings to reorder. |
| error |
|
Definition at line 324 of file paulis.cpp.