From 63d7a3ab4d24f16e4b5e5df9df930dc493e3e404 Mon Sep 17 00:00:00 2001 From: a_corni Date: Tue, 11 Jul 2023 10:24:48 +0200 Subject: [PATCH 1/5] Modify API --- docs/source/apidoc/simulation.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/source/apidoc/simulation.rst b/docs/source/apidoc/simulation.rst index 0d5a5a9de..752e2fdc4 100644 --- a/docs/source/apidoc/simulation.rst +++ b/docs/source/apidoc/simulation.rst @@ -5,9 +5,14 @@ Classical Simulation Since version 0.6.0, all simulation classes (previously under the ``pulser.simulation`` module) are in the ``pulser-simulation`` extension and should be imported from ``pulser_simulation``. -Simulation +QutipEmulator ---------------------- +:class:`QutipEmulator` is the class to simulate :class:`SequenceSamples`, that are samples of a :class:`Sequence`. +It is possible to simulate directly a :class:`Sequence` object by using the class method +`SequenceSamples.from_sequence`. Since version 0.14.0, the :class:`Simulation` class is deprecated +for :class:`QutipEmulator`. + .. automodule:: pulser_simulation.simulation :members: From 03031a4fcd17bf472bf6dfdbff8eac47225cbb82 Mon Sep 17 00:00:00 2001 From: a_corni Date: Tue, 11 Jul 2023 11:41:07 +0200 Subject: [PATCH 2/5] Delete Simulation from doc --- docs/source/apidoc/simulation.rst | 6 +++--- pulser-simulation/pulser_simulation/simulation.py | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/source/apidoc/simulation.rst b/docs/source/apidoc/simulation.rst index 752e2fdc4..9c7042eeb 100644 --- a/docs/source/apidoc/simulation.rst +++ b/docs/source/apidoc/simulation.rst @@ -10,10 +10,10 @@ QutipEmulator :class:`QutipEmulator` is the class to simulate :class:`SequenceSamples`, that are samples of a :class:`Sequence`. It is possible to simulate directly a :class:`Sequence` object by using the class method -`SequenceSamples.from_sequence`. Since version 0.14.0, the :class:`Simulation` class is deprecated -for :class:`QutipEmulator`. +``SequenceSamples.from_sequence``. Since version 0.14.0, the :class:`Simulation` class is deprecated +in favour of :class:`QutipEmulator`. -.. automodule:: pulser_simulation.simulation +.. autoclass:: pulser_simulation.simulation.QutipEmulator :members: SimConfig diff --git a/pulser-simulation/pulser_simulation/simulation.py b/pulser-simulation/pulser_simulation/simulation.py index 170c5d0b3..2ef4f8cf4 100644 --- a/pulser-simulation/pulser_simulation/simulation.py +++ b/pulser-simulation/pulser_simulation/simulation.py @@ -1156,6 +1156,8 @@ def from_sequence( class Simulation: r"""Simulation of a pulse sequence using QuTiP. + Note: This class is deprecated in favour of `QutipEmulator.from_sequence`. + Args: sequence: An instance of a Pulser Sequence that we want to simulate. From 9cf23efc154c05da889e7d125aa32567c71c2b28 Mon Sep 17 00:00:00 2001 From: a_corni Date: Tue, 11 Jul 2023 16:00:20 +0200 Subject: [PATCH 3/5] Add Simulation to docs --- docs/source/apidoc/simulation.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/source/apidoc/simulation.rst b/docs/source/apidoc/simulation.rst index 9c7042eeb..05b7f8d8b 100644 --- a/docs/source/apidoc/simulation.rst +++ b/docs/source/apidoc/simulation.rst @@ -16,6 +16,8 @@ in favour of :class:`QutipEmulator`. .. autoclass:: pulser_simulation.simulation.QutipEmulator :members: +.. autoclass:: pulser_simulation.simulation.Simulation + SimConfig ---------------------- From 07fb3c4fe6cb6a8b07e4271bee0b4bbe990ee099 Mon Sep 17 00:00:00 2001 From: a_corni Date: Tue, 11 Jul 2023 16:01:53 +0200 Subject: [PATCH 4/5] Modify module description, deprecation note --- pulser-simulation/pulser_simulation/simulation.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pulser-simulation/pulser_simulation/simulation.py b/pulser-simulation/pulser_simulation/simulation.py index 2ef4f8cf4..bd1151e67 100644 --- a/pulser-simulation/pulser_simulation/simulation.py +++ b/pulser-simulation/pulser_simulation/simulation.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -"""Contains the Simulation class, used for simulation of a Sequence.""" +"""Defines the QutipEmulator, used to simulate a Sequence or its samples.""" from __future__ import annotations @@ -1156,7 +1156,8 @@ def from_sequence( class Simulation: r"""Simulation of a pulse sequence using QuTiP. - Note: This class is deprecated in favour of `QutipEmulator.from_sequence`. + Note: + This class is deprecated in favour of `QutipEmulator.from_sequence`. Args: sequence: An instance of a Pulser Sequence that we From a12191f2e2fb7bdd2499d42160de8eb50a64cead Mon Sep 17 00:00:00 2001 From: a_corni Date: Thu, 13 Jul 2023 16:05:42 +0200 Subject: [PATCH 5/5] Taking into account review comments --- docs/source/apidoc/simulation.rst | 2 +- pulser-simulation/pulser_simulation/simulation.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/apidoc/simulation.rst b/docs/source/apidoc/simulation.rst index 05b7f8d8b..46c49f870 100644 --- a/docs/source/apidoc/simulation.rst +++ b/docs/source/apidoc/simulation.rst @@ -10,7 +10,7 @@ QutipEmulator :class:`QutipEmulator` is the class to simulate :class:`SequenceSamples`, that are samples of a :class:`Sequence`. It is possible to simulate directly a :class:`Sequence` object by using the class method -``SequenceSamples.from_sequence``. Since version 0.14.0, the :class:`Simulation` class is deprecated +``QutipEmulator.from_sequence``. Since version 0.14.0, the :class:`Simulation` class is deprecated in favour of :class:`QutipEmulator`. .. autoclass:: pulser_simulation.simulation.QutipEmulator diff --git a/pulser-simulation/pulser_simulation/simulation.py b/pulser-simulation/pulser_simulation/simulation.py index bd1151e67..e2f36b1ba 100644 --- a/pulser-simulation/pulser_simulation/simulation.py +++ b/pulser-simulation/pulser_simulation/simulation.py @@ -1156,8 +1156,8 @@ def from_sequence( class Simulation: r"""Simulation of a pulse sequence using QuTiP. - Note: - This class is deprecated in favour of `QutipEmulator.from_sequence`. + Warning: + This class is deprecated in favour of ``QutipEmulator.from_sequence``. Args: sequence: An instance of a Pulser Sequence that we