Skip to content

Commit

Permalink
Add DMM, methods of RegisterLayout inherited from Traps, Result (#587)
Browse files Browse the repository at this point in the history
* Add DMM, Inherited meth in RegisterLayout, Result

* Add inheritance

* Add DetuningMap

* Fxing syntax

* Fix path for DetuningMap

* Add QutipResult, fixing typo, generate dmm class

* Add QutipResult to rtd
  • Loading branch information
a-corni authored Sep 27, 2023
1 parent e0943d9 commit b51a23d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
22 changes: 21 additions & 1 deletion docs/source/apidoc/core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ The register classes allow for the creation of arbitrary registers.
Register layout
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A ``RegisterLayout`` is used to define a register from a set of traps. It is
intended to be given to the user by the hardware provided as a way of showing
intended to be given to the user by the hardware provider as a way of showing
which layouts are already available on a given device. In turn, the user
can create a ``Register`` by selecting the traps on which to place atoms, or
even a ``MappableRegister``, which allows for the creation of sequences whose
register can be defined at build time.

.. autoclass:: pulser.register.register_layout.RegisterLayout
:members:
:inherited-members:

.. autoclass:: pulser.register.mappable_reg.MappableRegister
:members:
Expand All @@ -51,6 +52,17 @@ Special cases
:members:
:show-inheritance:

DetuningMap
-------------------

A ``DetuningMap`` is associated to a ``DMM`` in a ``Sequence``. It links a set
of weights to a set of trap coordinates. It is intended to be defined by the user
from a ``RegisterLayout``, a ``Register`` or a ``MappableRegister`` using
``define_detuning_map``.

.. autoclass:: pulser.register.weight_maps.DetuningMap
:members:
:inherited-members:

Pulse
-------------------
Expand Down Expand Up @@ -114,6 +126,9 @@ Available Channels
:members:
:show-inheritance:

.. autoclass:: pulser.channels.dmm.DMM
:members:
:show-inheritance:

EOM Mode Configuration
^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -129,3 +144,8 @@ Sampler
.. automodule:: pulser.sampler.samples
:members:

Result
------------------
.. automodule:: pulser.result
:members:
:show-inheritance:
13 changes: 10 additions & 3 deletions docs/source/apidoc/simulation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,20 @@ Simulation Results

Depending on the types of noise involved in a simulation, the results are returned
as an instance of :class:`SimulationResults`, namely :class:`CoherentResults`
(when the results can still be represented as a state vector or a density matrix, before being measured)
or :class:`NoisyResults` (when they can only be represented as a probability
distribution over the basis states).
(when each result can still be represented as a :class:`QutipResult` i.e. a state vector
or a density matrix, before being measured) or :class:`NoisyResults` (when each of them can only
be represented as :class:`SampledResult` i.e. a probability distribution over the basis states).

Both classes feature methods for processing and displaying the results stored
within them.

QutipResult
^^^^^^^^^^^^^^^^

.. autoclass:: pulser_simulation.qutip_result.QutipResult
:members:
:inherited-members:

CoherentResults
^^^^^^^^^^^^^^^^

Expand Down
3 changes: 3 additions & 0 deletions pulser-simulation/pulser_simulation/qutip_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import numpy as np
import qutip

from pulser.register import QubitId
from pulser.result import Result


Expand All @@ -37,6 +38,8 @@ class QutipResult(Result):
same as the state's basis.
"""

atom_order: tuple[QubitId, ...]
meas_basis: str
state: qutip.Qobj
matching_meas_basis: bool

Expand Down

0 comments on commit b51a23d

Please sign in to comment.