Skip to content

Commit

Permalink
Initial arraylias module API docs (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanPuzzuoli authored Feb 28, 2024
1 parent f99d651 commit bec7cba
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 5 deletions.
6 changes: 6 additions & 0 deletions docs/apidocs/arraylias.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _qiskit_dynamics-arraylias:

.. automodule:: qiskit_dynamics.arraylias
:no-members:
:no-inherited-members:
:no-special-members:
1 change: 1 addition & 0 deletions docs/apidocs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ Qiskit Dynamics API Reference
signals
pulse
perturbation
arraylias
array
dispatch
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
autoclass_content = "both"
intersphinx_mapping = {
"qiskit": ("https://docs.quantum.ibm.com/api/qiskit", None),
"qiskit_experiments": ("https://qiskit-extensions.github.io/qiskit-experiments/", None)
"qiskit_experiments": ("https://qiskit-extensions.github.io/qiskit-experiments/", None),
"arraylias": ("https://qiskit-extensions.github.io/arraylias/", None)
}

# nbsphinx options (for tutorials)
Expand Down
47 changes: 43 additions & 4 deletions qiskit_dynamics/arraylias/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,52 @@
# that they have been altered from the originals.

r"""
=========================================
Models (:mod:`qiskit_dynamics.arraylias`)
=========================================
============================================
Arraylias (:mod:`qiskit_dynamics.arraylias`)
============================================
.. currentmodule:: qiskit_dynamics.arraylias
Module for Qiskit Dynamics global NumPy and SciPy aliases.
This module contains Qiskit Dynamics-global extensions of the default NumPy and SciPy aliases
provided by `Arraylias <https://qiskit-extensions.github.io/arraylias/>`_. These are used to manage
dispatching of array operations for the different array types supported by Qiskit Dynamics. They
have been configured beyond the `Arraylias <https://qiskit-extensions.github.io/arraylias/>`_
defaults to additionally support both `JAX <https://jax.readthedocs.io/en/latest/>`_ and SciPy
sparse types. The following table summarizes the registered libraries and respective types.
.. list-table:: Supported libraries
:widths: 10 70
:header-rows: 1
* - ``array_library``
- Registered types
* - ``"numpy"``
- Default supported by the Arraylias NumPy and SciPy aliases.
* - ``"jax"``
- Default supported by the Arraylias NumPy and SciPy aliases.
* - ``"jax_sparse"``
- The JAX ``jax.experimental.sparse.BCOO`` array type.
* - ``"scipy_sparse"``
- Subclasses of the ``scipy.sparse.spmatrix`` sparse base class. When instantiating SciPy
sparse arrays, the alias will specifically create ``scipy.sparse.csr_matrix`` instances.
The global configured aliases and the aliased libraries can be imported from
``qiskit_dynamics.arraylias``, and are summarized by the following table.
.. list-table:: Configured Arraylias objects
:widths: 10 70
:header-rows: 1
* - Arraylias object
- Description
* - ``DYNAMICS_NUMPY_ALIAS``
- Qiskit Dynamics-global NumPy alias.
* - ``DYNAMICS_SCIPY_ALIAS``
- Qiskit Dynamics-global SciPy alias.
* - ``DYNAMICS_NUMPY``
- Qiskit Dynamics-global aliased NumPy library.
* - ``DYNAMICS_SCIPY``
- Qiskit Dynamics-global aliased SciPy library.
"""

from .alias import (
Expand Down

0 comments on commit bec7cba

Please sign in to comment.