![]() |
The Quantum Exact Simulation Toolkit v4.2.0
|
Functions for using Trotterisation to approximate the action of exponentials of weighted sums of Pauli tensors upon Quregs. More...
Functions | |
void | applyTrotterizedControlledPauliStrSumGadget (Qureg qureg, int control, PauliStrSum sum, qreal angle, int order, int reps) |
void | applyTrotterizedMultiControlledPauliStrSumGadget (Qureg qureg, int *controls, int numControls, PauliStrSum sum, qreal angle, int order, int reps) |
void | applyTrotterizedMultiStateControlledPauliStrSumGadget (Qureg qureg, int *controls, int *states, int numControls, PauliStrSum sum, qreal angle, int order, int reps) |
void | applyTrotterizedNonUnitaryPauliStrSumGadget (Qureg qureg, PauliStrSum sum, qcomp angle, int order, int reps) |
void | applyTrotterizedPauliStrSumGadget (Qureg qureg, PauliStrSum sum, qreal angle, int order, int reps) |
Functions for using Trotterisation to approximate the action of exponentials of weighted sums of Pauli tensors upon Quregs.
void applyTrotterizedControlledPauliStrSumGadget | ( | Qureg | qureg, |
int | control, | ||
PauliStrSum | sum, | ||
qreal | angle, | ||
int | order, | ||
int | reps ) |
Definition at line 173 of file trotterisation.cpp.
void applyTrotterizedMultiControlledPauliStrSumGadget | ( | Qureg | qureg, |
int * | controls, | ||
int | numControls, | ||
PauliStrSum | sum, | ||
qreal | angle, | ||
int | order, | ||
int | reps ) |
Definition at line 184 of file trotterisation.cpp.
void applyTrotterizedMultiStateControlledPauliStrSumGadget | ( | Qureg | qureg, |
int * | controls, | ||
int * | states, | ||
int | numControls, | ||
PauliStrSum | sum, | ||
qreal | angle, | ||
int | order, | ||
int | reps ) |
Definition at line 195 of file trotterisation.cpp.
void applyTrotterizedNonUnitaryPauliStrSumGadget | ( | Qureg | qureg, |
PauliStrSum | sum, | ||
qcomp | angle, | ||
int | order, | ||
int | reps ) |
A generalisation of applyTrotterizedPauliStrSumGadget() which accepts a complex angle
and permits sum
to be non-Hermitian, thereby effecting a potentially non-unitary and non-CPTP operation.
Let \( \hat{H} = \) sum
and \( \theta = \) angle
\( \in \mathbb{C} \). 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
).
See applyTrotterizedPauliStrSumGadget() for more information about the decomposition.
angle
is set to \( \theta = \iu \, \Delta \tau \) and sum
= \( \hat{H} \) is Hermitian, this function (approximately) evolves qureg
in imaginary-time for duration \( \Delta \tau \), effecting non-unitary propagator \[ \exp(- \Delta \tau \hat{H}) \]
as utilised by applyTrotterizedImaginaryTimeEvolution().angle
is real and sum
is Hermitian (i.e. has approximately real coefficients), the effected operation is unitary and this function becomes equivalent to applyTrotterizedPauliStrSumGadget().sum
= \( \hat{H} \) commute.[in,out] | qureg | the state to modify. |
[in] | sum | a weighted sum of Pauli strings to approximately exponentiate. |
[in] | angle | an effective prefactor of sum in the exponent. |
[in] | order | the order of the Trotter-Suzuki decomposition (e.g. 1 , 2 , 4 , ...). |
[in] | reps | the number of Trotter repetitions. |
error |
|
Definition at line 150 of file trotterisation.cpp.
void applyTrotterizedPauliStrSumGadget | ( | Qureg | qureg, |
PauliStrSum | sum, | ||
qreal | angle, | ||
int | order, | ||
int | reps ) |
Effects an approximation to the exponential of sum
, weighted by angle
times \( i \), upon qureg
, via the symmetrized Trotter-Suzuki decomposition (arXiv). Increasing reps
(the number of Trotter repetitions) or order
(an even, positive integer or one) improves the accuracy of the approximation by reducing the "Trotter error" due to non-commuting terms of sum
, though increases the runtime linearly and exponentially respectively.
Let \( \hat{H} = \) sum
and \( \theta = \) angle
\( \in \mathbb{R} \). 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
). Simulation is exact, regardless of order
or reps
, only when all terms in sum
commute.
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 coefficient of the \( j \)-th PauliStr \( \hat{\sigma}_j \).
order=1
, this function performs first-order Trotterisation, where the terms of sum
are effected in a repeated, arbitrary but fixed order. \[ \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). \]
order=2
, this function performs the lowest order "symmetrized" Suzuki decomposition, whereby each repetition effects the terms of sum
forward then in reverse. \[ \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]. \]
order
(denoted by symbol \( n \)) invoke higher-order symmetrized decompositions \( S[\theta,n,r] \). These see the lower order Trotter circuits repeated twice forward, then reversed, then twice forward again, recursively. To be precise, 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).
sum
= \( \hat{H} \) over a duration of \( \Delta t \), as described by propagator \[ \hat{U}(\Delta t) = \exp(- \iu \, \Delta t \,\hat{H} \, / \, \hbar), \]
as utilised by the function applyTrotterizedUnitaryTimeEvolution().qcomp
instance with a zero imaginary component as the angle
parameter. This latter function is useful for generalising dynamical simulation to imaginary-time evolution.sum
is Hermitian, ergo containing only real coefficients. Validation will check that sum
is approximately Hermitian, permitting coefficients with imaginary components smaller (in magnitude) than epsilon. \[ \max\limits_{i} |c_i| \le \valeps \]
where the validation epsilon \( \valeps \) can be adjusted with setValidationEpsilon(). Otherwise, use applyTrotterizedNonUnitaryPauliStrSumGadget() to permit non-Hermitiansum
and ergo effect a non-unitary exponential(s).angle
parameter is necessarily real to retain unitarity, but can be relaxed to an arbitrary complex scalar (i.e. a qcomp
) using applyTrotterizedNonUnitaryPauliStrSumGadget(). This permits cancelling the complex unit \( i \) to effect non-unitary \( \exp(\theta \, \hat{H}) \) as is useful for imaginary-time evolution.sum
= \( \hat{H} \) commute, or reps
\( \rightarrow \infty \).[in,out] | qureg | the state to modify. |
[in] | sum | a weighted sum of Pauli strings to approximately exponentiate. |
[in] | angle | the prefactor of sum times \( i \) in the exponent. |
[in] | order | the order of the Trotter-Suzuki decomposition (e.g. 1 , 2 , 4 , ...). |
[in] | reps | the number of Trotter repetitions. |
error |
|
Definition at line 162 of file trotterisation.cpp.