Skip to content

Commit 19e18b2

Browse files
committed
updated dynamics examples to use time-evol
in lieu of direct gadgets, for clarity
1 parent 9c6754a commit 19e18b2

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

examples/extended/dynamics.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/** @file
2-
* An example of using QuEST (primarily function
3-
* applyTrotterizedPauliStrSumGadget()) to perform
2+
* An example of using QuEST to perform closed
43
* dynamical simulation via Trotterisation of the
54
* unitary-time evolution operator.
65
*
@@ -158,7 +157,7 @@ int main() {
158157
for (int i=0; i<steps; i++) {
159158

160159
// evolve qureg under (approx) exp(-i dt H)
161-
applyTrotterizedPauliStrSumGadget(qureg, hamil, -dt, order, reps);
160+
applyTrotterizedUnitaryTimeEvolution(qureg, hamil, dt, order, reps);
162161

163162
// calculate and report <O>
164163
qreal time = dt * (i+1);
@@ -188,7 +187,7 @@ int main() {
188187

189188
// verify results by uninterrupted higher-order simulation to target time
190189
initPlusState(qureg);
191-
applyTrotterizedPauliStrSumGadget(qureg, hamil, -dt*steps, order+2, reps*steps);
190+
applyTrotterizedUnitaryTimeEvolution(qureg, hamil, dt*steps, order+2, reps*steps);
192191
reportScalar("final <O>", calcExpecPauliStrSum(qureg, observ));
193192

194193
// clean up

examples/extended/dynamics.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/** @file
2-
* An example of using QuEST (primarily function
3-
* applyTrotterizedPauliStrSumGadget()) to perform
2+
* An example of using QuEST to perform closed
43
* dynamical simulation via Trotterisation of the
54
* unitary-time evolution operator.
65
*
@@ -155,7 +154,7 @@ int main() {
155154
for (int i=0; i<steps; i++) {
156155

157156
// evolve qureg under (approx) exp(-i dt H)
158-
applyTrotterizedPauliStrSumGadget(qureg, hamil, -dt, order, reps);
157+
applyTrotterizedUnitaryTimeEvolution(qureg, hamil, dt, order, reps);
159158

160159
// calculate and report <O>
161160
qreal time = dt * (i+1);
@@ -182,7 +181,7 @@ int main() {
182181

183182
// verify results by uninterrupted higher-order simulation to target time
184183
initPlusState(qureg);
185-
applyTrotterizedPauliStrSumGadget(qureg, hamil, -dt*steps, order+2, reps*steps);
184+
applyTrotterizedUnitaryTimeEvolution(qureg, hamil, dt*steps, order+2, reps*steps);
186185
reportScalar("final <O>", calcExpecPauliStrSum(qureg, observ));
187186

188187
// clean up

0 commit comments

Comments
 (0)