From 299c94a92bce318f38e4ebaaccab21b55f2559be Mon Sep 17 00:00:00 2001 From: DanPuzzuoli Date: Wed, 28 Feb 2024 09:28:28 -0800 Subject: [PATCH] removing old use of copy --- .../models/rotating_wave_approximation.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/qiskit_dynamics/models/rotating_wave_approximation.py b/qiskit_dynamics/models/rotating_wave_approximation.py index 02e1549fd..eeabc8b60 100644 --- a/qiskit_dynamics/models/rotating_wave_approximation.py +++ b/qiskit_dynamics/models/rotating_wave_approximation.py @@ -75,18 +75,19 @@ def function_with_rwa(t): .. code-block:: python - rwa_model, signal_map = rotating_wave_approximation(model, - cutoff_freq, - return_signal_map=True) + rwa_model, signal_map = rotating_wave_approximation( + model, + cutoff_freq, + return_signal_map=True + ) The following function **is** JAX-transformable: .. code-block:: python def jax_transformable_func(t): - rwa_model_copy = rwa_model.copy() - rwa_model_copy.signals = signal_map(new_signals) - return rwa_model_copy(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.