In the pauli propagation example each gate is executed in a for loop. At the end of the loop the views are swapped for the next iteration (so the 'in' one becomes 'out' and viceversa).
In order to preserve the last 'out' view as the 'out' view, after the for another swap is done:
|
std::swap(inExpansion, outExpansion); |
This seems ok so far, but then when computing the expectation value, the 'in' view is used:
|
HANDLE_CUPP_ERROR(cupaulipropPauliExpansionGetNumTerms(handle, inExpansion, &numOutTerms)); |
Shouldn't be that replaced by the 'out' expansion?
In the pauli propagation example each gate is executed in a for loop. At the end of the loop the views are swapped for the next iteration (so the 'in' one becomes 'out' and viceversa).
In order to preserve the last 'out' view as the 'out' view, after the
foranother swap is done:cuQuantum/samples/cupauliprop/kicked_ising_example.cpp
Line 614 in 4e097de
This seems ok so far, but then when computing the expectation value, the 'in' view is used:
cuQuantum/samples/cupauliprop/kicked_ising_example.cpp
Line 631 in 4e097de
Shouldn't be that replaced by the 'out' expansion?