Skip to content

Commit

Permalink
Updates to the documentation (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
HGSilveri authored Feb 28, 2022
1 parent 50f74eb commit 3309a3c
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
37 changes: 36 additions & 1 deletion docs/source/apidoc/creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,43 @@ Sequence
Register
----------------------

.. automodule:: pulser.register
Register classes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The register classes allow for the creation of arbitrary registers.

.. autoclass:: pulser.register.base_register.BaseRegister
:members:

.. autoclass:: pulser.register.register.Register
:members:
:show-inheritance:

.. autoclass:: pulser.register.register3d.Register3D
:members:
:show-inheritance:


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
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:


Special cases
""""""""""""""""""

.. automodule:: pulser.register.special_layouts
:members:
:show-inheritance:


Pulse
-------------------

Expand Down Expand Up @@ -46,6 +79,8 @@ which when associated with a :class:`pulser.Sequence` condition its development.

.. autodata:: pulser.devices.Chadoq2

.. autodata:: pulser.devices.IroiseMVP

The MockDevice
^^^^^^^^^^^^^^^^
A very permissive device that supports sequences which are currently unfeasible
Expand Down
4 changes: 4 additions & 0 deletions pulser/register/register_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ def make_mappable_register(
prefix (str): The prefix for the qubit ids. Each qubit ID starts
with the prefix, followed by an int from 0 to N-1
(e.g. prefix='q' -> IDs: 'q0', 'q1', 'q2', ...).
Returns:
MappableRegister: A substitute for a regular register that can be
used to initialize a Sequence.
"""
qubit_ids = [f"{prefix}{i}" for i in range(n_qubits)]
return MappableRegister(self, *qubit_ids)
Expand Down

0 comments on commit 3309a3c

Please sign in to comment.