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 si(t)etFGietF, in the basis in which F is diagonal, the (j,k) element of Gi has effective frequency ν~ijk±=±νi+Im[dj+dk]/2π, where the ±νi comes from expressing si(t)=Re[ai(t)e2πiνit]=ai(t)ei(2πνit+ϕi)/2+c.c. and the other term comes from the rotating frame. Define Gi± the matrix whose entries (Gi±)jk are the entries of Gi s.t. |νijk±|<ν for some cutoff frequency ν. Then, after the RWA, we may write

si(t)GiGi+aiei(2πνit+ϕi)/2+Giaiei(2πνit+ϕi)/2.

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

si(t)Gisi(t)(Gi++Gi)/2+si(t)(iGi+iGi)

where si(t) is a signal with the same frequency and amplitude as si, but with a phase shift of ϕiπ/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.