-
Notifications
You must be signed in to change notification settings - Fork 169
Description
The function applyTrotterizedPauliStrSumGadget() effects an approximation of exp(i angle PauliStrSum) using higher-order Suzuki-Trotter decomposition. Users can improve its accuracy by increasing the order and reps parameters.
The base accuracy however can be improved either/both by:
- randomising the effected order of the
PauliStrSumterms within each repetition (as described here). - grouping
PauliStrSumterms into commuting groups which, whenexp(i term)within are effected contiguously, induce no Trotter error.
Note that optimally grouping commuting terms is known to be NP-hard, but there exist a myriad of greedy/heuristic terms to find suboptimal groups. For example this work greedily reduces the number of needed gadgets, offering both an accuracy and runtime improvement, and this work.
The applyTrotterizedPauliStrSumGadget() function can be improved by:
- introducing randomisation, using the RNG in
randomiser.cpp, which users can ergo control (to deterministically repeat a previous Trotter circuit) using routines likesetSeeds() - pre-grouping
PauliStrSuminto (suboptimal) commuting groups. If sufficiently quick, this could be done each time the Trotter function is called. - pre-grouping could alternatively be done once, caching the commuting groups for re-use on subsequent Trotter invocation. This could be elegantly done via added a new
int* groupSizesterm, initiallyNULL. WhenapplyTrotterizedPauliStrSumGadget()is first called, the.stringsand.termsfields ofPauliStrSumcan be reordered, and.groupSizesheap-allocated to contain the number of contiguous terms in each group. When needed, the total number of groups can be runtime inferred by enumerating.groupSizesuntil its reduction equalsnumTerms.- An alternative, simpler design could preserve
.stringsand.termsordering and add new fields.groupSizes,.groupIndicesand.numGroupsfields.
- An alternative, simpler design could preserve
Beware that a new commuting-groups field will mean that an existing
PauliStrSummust never have its fields directly modified, since this
might corrupt the groups.