The Quantum Exact Simulation Toolkit v4.0.0
Loading...
Searching...
No Matches

Functions for applying, exponentiating or Trotterising a weigthed sum of Pauli tensors. More...

Functions

void applyTrotterizedPauliStrSumGadget (Qureg qureg, PauliStrSum sum, qreal angle, int order, int reps)
 
void multiplyPauliStrSum (Qureg qureg, PauliStrSum sum, Qureg workspace)
 

Detailed Description

Functions for applying, exponentiating or Trotterising a weigthed sum of Pauli tensors.

Function Documentation

◆ applyTrotterizedPauliStrSumGadget()

void applyTrotterizedPauliStrSumGadget ( Qureg qureg,
PauliStrSum sum,
qreal angle,
int order,
int reps )
Note
Documentation for this function or struct is under construction!
Warning
This function has not yet been unit tested and may contain bugs. Please use with caution!
Formulae

Let \( \hat{H} = \) sum and \( \theta = \) angle. This function approximates the action of

\[ \exp \left(\iu \, \theta \, \hat{H} \right) \]

via a Trotter-Suzuki decomposition of the specified order and number of repetitions (reps).

To be precise, let \( r = \) reps and assume sum is composed of \( T \)-many terms of the form

\[ \hat{H} = \sum\limits_j^T c_j \, \hat{\sigma}_j \]

where \( c_j \) is the (necessarily real) coefficient of the \( j \)-th PauliStr \( \hat{\sigma}_j \).

  • When order=1, this function performs first-order Trotterisation, whereby

    \[ \exp(\iu \, \theta \, \hat{H} ) \approx \prod\limits^{r} \prod\limits_{j=1}^{T} \exp \left( \iu \, \frac{\theta \, c_j}{r} \, \hat\sigma_j \right). \]

  • When order=2, this function performs the lowest order "symmetrized" Suzuki decomposition, whereby

    \[ \exp(\iu \, \theta \, \hat{H} ) \approx \prod\limits^{r} \left[ \prod\limits_{j=1}^{T} \exp \left( \iu \frac{\theta \, c_j}{2 \, r} \hat\sigma_j \right) \prod\limits_{j=T}^{1} \exp \left( \iu \frac{\theta \, c_j}{2 \, r} \hat\sigma_j \right) \right]. \]

  • Greater, even values of order (denoted by symbol \( n \)) invoke higher-order symmetrized decompositions \( S[\theta,n,r] \). Letting \( p = \left( 4 - 4^{1/(n-1)} \right)^{-1} \), these satisfy

    \begin{align*} S[\theta, n, 1] &= \left( \prod\limits^2 S[p \, \theta, n-2, 1] \right) S[ (1-4p)\,\theta, n-2, 1] \left( \prod\limits^2 S[p \, \theta, n-2, 1] \right), \\ S[\theta, n, r] &= \prod\limits^{r} S\left[\frac{\theta}{r}, n, 1\right]. \end{align*}

‍These formulations are taken from 'Finding Exponential Product Formulas of Higher Orders', Naomichi Hatano and Masuo Suzuki (2005) (arXiv).

Definition at line 1168 of file operations.cpp.

1168 {
1169 validate_quregFields(qureg, __func__);
1170 validate_pauliStrSumFields(sum, __func__);
1171 validate_pauliStrSumTargets(sum, qureg, __func__);
1172 validate_pauliStrSumIsHermitian(sum, __func__);
1173 validate_trotterParams(qureg, order, reps, __func__);
1174
1175 /// @todo
1176 /// the accuracy of Trotterisation is greatly improved by randomisation
1177 /// or (even sub-optimal) grouping into commuting terms. Should we
1178 /// implement these here or into another function?
1179
1180 if (angle == 0)
1181 return;
1182
1183 for (int r=0; r<reps; r++)
1184 applyHigherOrderTrotter(qureg, sum, angle/reps, order);
1185}

◆ multiplyPauliStrSum()

void multiplyPauliStrSum ( Qureg qureg,
PauliStrSum sum,
Qureg workspace )
Note
Documentation for this function or struct is under construction!
Attention
This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!
See also
multiplyCompMatr1()

Definition at line 1111 of file operations.cpp.

1111 {
1112 validate_quregFields(qureg, __func__);
1113 validate_quregFields(workspace, __func__);
1114 validate_quregCanBeWorkspace(qureg, workspace, __func__);
1115 validate_pauliStrSumFields(sum, __func__);
1116 validate_pauliStrSumTargets(sum, qureg, __func__);
1117
1118 // clone qureg to workspace, set qureg to blank
1119 localiser_statevec_setQuregToSuperposition(0, workspace, 1, qureg, 0, qureg);
1120 localiser_statevec_initUniformState(qureg, 0);
1121
1122 // apply each term in-turn, mixing into output qureg, then undo using idempotency
1123 for (qindex i=0; i<sum.numTerms; i++) {
1124 localiser_statevec_anyCtrlPauliTensor(workspace, {}, {}, sum.strings[i]);
1125 localiser_statevec_setQuregToSuperposition(1, qureg, sum.coeffs[i], workspace, 0, workspace);
1126 localiser_statevec_anyCtrlPauliTensor(workspace, {}, {}, sum.strings[i]);
1127 }
1128
1129 // workspace -> qureg, and qureg -> sum * qureg
1130}

Referenced by TEST_CASE().