qiskit_dynamics.models.rotating_wave_approximation#

rotating_wave_approximation(model, cutoff_freq, return_signal_map=False)[source]#

Construct a new model by performing the rotating wave approximation with a given cutoff frequency. The outputs of this function can be used in JAX-transformable functions, however this function itself cannot (see below).

Performs elementwise rotating wave approximation (RWA) with cutoff frequency cutoff_freq on each operator in a model, returning a new model. The new model contains a modified list of signal coefficients, and setting the optional argument return_signal_map=True results in the additional return of the function f which maps the signals of the input model to those of the output RWA model, such that the code blocks:

model.signals = new_signals
rwa_model = rotating_wave_approximation(model, cutoff_freq)

and

rwa_model, f = rotating_wave_approximation(model, cutoff_freq, return_signal_map=True)
rwa_model.signals = f(new_signals)

result in an rwa_model with the same updated signals.

Note

The rotating_wave_approximation function itself cannot be included in a function to-be JAX-transformed, however the resulting model and signal_map can. For example, the following function is not JAX-transformable:

def function_with_rwa(t):
    operators = ...
    signals = ...
    model = GeneratorModel(operators=operators, signals=signals)
    rwa_model = rotating_wave_approximation(model, cutoff_freq)
    return rwa_model(t)

Whereas, defining:

rwa_model, signal_map = rotating_wave_approximation(
    model,
    cutoff_freq,
    return_signal_map=True
)

The following function is JAX-transformable:

def jax_transformable_func(t):
    rwa_model.signals = signal_map(new_signals)
    return rwa_model(t)

In this way, the outputs of rotating_wave_approximation can be used in JAX-transformable functions, however rotating_wave_approximation itself cannot.

We now describe the formalism. When considering \(s_i(t) e^{-tF}G_ie^{tF}\), in the basis in which \(F\) is diagonal, the \((j, k)\) element of \(G_i\) has effective frequency \(\tilde\nu_{ijk}^\pm = \pm\nu_i + Im[-d_j+d_k]/2\pi\), where the \(\pm\nu_i\) comes from expressing \(s_i(t) = Re[a_i(t)e^{2\pi i\nu_i t}] = a_i(t)e^{i(2\pi\nu_i t+\phi_i)}/2 + c.c.\) and the other term comes from the rotating frame. Define \(G_i^\pm\) the matrix whose entries \((G_i^\pm)_{jk}\) are the entries of \(G_i\) s.t. \(|\nu_{ijk}^\pm|<\nu_*\) for some cutoff frequency \(\nu_*\). Then, after the RWA, we may write

\[s_i(t)G_i \to G_i^+ a_ie^{i(2\pi \nu_i t+\phi_i)}/2 + G_i^- \overline{a_i}e^{-i(2\pi \nu_i t+\phi_i)}/2.\]

When we regroup these to use only the real components of the signal, we find that

\[s_i(t)G_i \to s_i(t)(G_i^+ + G_i^-)/2 + s_i'(t)(iG_i^+-iG_i^-)\]

where \(s_i'(t)\) is a signal with the same frequency and amplitude as \(s_i\), but with a phase shift of \(\phi_i - \pi/2\).

Parameters:
  • model (BaseGeneratorModel) – The model to approximate.

  • cutoff_freq (float) – The cutoff frequency for the approximation.

  • return_signal_map (Optional[bool]) – Whether to also return the function for mapping pre-RWA signals to post-RWA signals.

Return type:

BaseGeneratorModel

Returns:

GeneratorModel with twice as many terms, and, if return_signal_map, also the function f.

Raises:

ValueError – If the model has no signals.