pasqal-io / Pulser

Library for pulse-level/analog control of neutral atom devices. Emulator with QuTiP.
Apache License 2.0
182 stars 65 forks source link

Centralize all backend imports from a single `pulser.backends` module #678

Closed HGSilveri closed 7 months ago

HGSilveri commented 7 months ago

This features adds a new pulser.backends module that should serve as the single source for all backends. Ideally, the user can now simple do eg

import pulser

qutip_backend = pulser.backends.QutipBackend(...)

If pulser_simulation is not installed, an error message will appear suggesting its installation.

AttributeError: 'QutipBackend' requires the 'pulser_simulation' package. To install it, run `pip install pulser_simulation`.

The same is true for the pulser_pasqal backends.

Imports like

from pulser.backends import QutipBackend, EmuTNBackend

also work, but in this case the error message is not informative if the appropriate extension packages are not installed.

review-notebook-app[bot] commented 7 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB