Skip to content

dq.floquet

floquet(
    H: ArrayLike | TimeArray,
    T: float,
    tsave: ArrayLike,
    *,
    solver: Solver = Tsit5(),
    gradient: Gradient | None = None,
    options: Options = Options()
) -> FloquetResult

Compute Floquet modes and quasienergies of a periodic closed system.

The Floquet modes \(\Phi_{m}(t_0)\) and corresponding quasienergies \(\epsilon_m\) are defined by the eigenvalue equation $$ U(t_0, t_0+T)\Phi_{m}(t_0) = \exp(-i \epsilon_{m} T)\Phi_{m}(t_0), $$ where \(U(t_0, t_0+T)\) is the propagator over a single period \(T\), with \(t_0\) some arbitrary initial time (typically \(t_0 = 0\)). According to the Floquet theorem, these Floquet modes are periodic with period \(T\) and form a complete basis for the time evolution of the system. The \(t=t_0\) Floquet modes are obtained from diagonalization of the above propagator, while the \(t \geq t_0\) Floquet modes are obtained by propagating the \(t=t_0\) Floquet modes forward in time, via $$ \Phi_{m}(t) = \exp(i\epsilon_{m}t)U(t_0, t_0+t)\Phi_{m}(t_0). $$

Warning

floquet is not yet GPU compatible because jax.numpy.linalg.eig is only implemented on the CPU backend, see here. However, a GPU implementation of eig is currently in the works, see here.

Batching over drive periods

The current API does not yet natively support batching over multiple drive periods, for instance if you wanted to batch over Hamiltonians with different drive frequencies. This however can be achieved straightforwardly with an external call to jax.vmap, as follows:

import jax
import jax.numpy as jnp
import dynamiqs as dq


def single_floquet(omega):
    H = dq.modulated(lambda t: jnp.cos(omega * t), dq.sigmax())
    T = 2.0 * jnp.pi / omega
    tsave = jnp.linspace(0.0, T, 11)
    return dq.floquet(H, T, tsave)


omegas = jnp.array([0.9, 1.0, 1.1])
batched_floquet = jax.vmap(single_floquet)
result = batched_floquet(omegas)

Parameters

  • H (array-like or time-array of shape (...H, n, n)) –

    Hamiltonian.

  • T –

    Period of the Hamiltonian. If the Hamiltonian is batched, the period should be common over all elements in the batch. To batch over different periods, wrap the call to floquet in a jax.vmap, see above.

  • tsave (array-like of shape (ntsave,)) –

    Times at which to compute floquet modes. The specified times should be ordered, strictly ascending, and such that tsave[-1] - tsave[0] <= T.

  • solver –

    Solver for the integration. Defaults to dq.solver.Tsit5 (supported: Tsit5, Dopri5, Dopri8, Kvaerno3, Kvaerno5, Euler).

  • gradient –

    Algorithm used to compute the gradient.

  • options –

    Generic options, see dq.Options.

Returns

dq.FloquetResult object holding the result of the Floquet computation. Use the attribute modes to access the saved Floquet modes, and the attribute quasienergies for the associated quasienergies, more details in dq.FloquetResult.