:orphan: .. _example22-label: Efficient time evolution using the omp-parallelized expm_multiply_parallel -------------------------------------------------------------------------- In this example, we demonstrate the usage of the function `tools.evolution.expm_multiply_parallel()`, designed to compute matrix exponentials for **static** Hamiltonians. One particular application of the matrix exponential is unitary dynamics generated by a static Hamiltonian (e.g., quantum quanches, etc.). In some cases, one can also use piecewise-constant functions to define a nontrivial dynamics: examples onclude periodically-driven systems, but also some Trotterization schemes. The function `tools.evolution.expm_multiply_parallel` is a modified, **omp-parallelized implementation** of `scipy.sparse.linalg.expm_multiply `_. See line 5 in the code snippet below to set the number of omp threads [omp version of QuSpin only!]. To showcase the usage of `tools.evolution.expm_multiply_parallel()`, consider unitary time evolution generated by the :math:`T`-periodic spin-1 Heisenberg-like Hamiltonian .. math:: H(t) = \bigg\{ \!\begin{array}{c}\! &H_0,\qquad 0\leq t\leq T/2 \\ \!&H_1,\qquad T/2`_, which takes into account finite-size corrections. As expected, the system heats up quickly to an infinite-temperature state. Script ------ :download:`download script <../../../examples/scripts/example22.py>` .. literalinclude:: ../../../examples/scripts/example22.py :linenos: :language: python :lines: 1-