Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Apr 25, 2024

Conversation

HGSilveri
Copy link
Collaborator

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.

@HGSilveri HGSilveri requested a review from a-corni April 23, 2024 10:04
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Collaborator

@a-corni a-corni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me !

@HGSilveri HGSilveri merged commit 716b86b into develop Apr 25, 2024
7 checks passed
@HGSilveri HGSilveri deleted the hs/backend-central branch April 25, 2024 08:09
soufianekaghad98 pushed a commit to soufianekaghad98/Pulser that referenced this pull request Apr 25, 2024
…pasqal-io#678)

* Centralize all backend imports

* Unit tests

* Update backends tutorial

* Fix error message
@HGSilveri HGSilveri mentioned this pull request Apr 29, 2024
HGSilveri added a commit that referenced this pull request Apr 29, 2024
Main changes:

21a47f3 Remove Register.rotate() (#642)
20e6765 FIX: Redefine slope of RampWaveform (#644)
c2d5b6c Enabling definition of multiple noise channels and noise channels in XY (#647)
bcb78cc Enable digital simulation (#652)
0f6e3dd Improve access to output modulation durations (#663)
188d21d Remove deprecated noise arguments (#674)
f303138 Adding relaxation noise channel (#675)
716b86b Centralize all backend imports from a single pulser.backends module (#678)
96a8c34 Add hyperfine dephasing rate to NoiseModel (#680)
4981ca6 Add optional default noise models to devices (#676)
c695373 Rectangular lattice register and layout (#665)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants