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

Load available simulators and platforms lazily in Python #239

Merged
merged 2 commits into from
Jun 14, 2023

Conversation

amccaskey
Copy link
Collaborator

Currently we create all available CircuitSimulators and quantum_platforms at Python startup. This is not very efficient since we'll likely only use one of each in a given Python execution.

Update to load these pointers lazily via storage of a creation functor for each.

Copy link
Collaborator

@schweitzpgi schweitzpgi left a comment

Choose a reason for hiding this comment

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

LGTM. Minor questions.

python/utils/LinkedLibraryHolder.cpp Outdated Show resolved Hide resolved
python/utils/LinkedLibraryHolder.h Outdated Show resolved Hide resolved
Signed-off-by: Alex McCaskey <amccaskey@nvidia.com>
Signed-off-by: Alex McCaskey <amccaskey@nvidia.com>
Copy link
Collaborator

@schweitzpgi schweitzpgi left a comment

Choose a reason for hiding this comment

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

+1

@amccaskey amccaskey merged commit 7b7ac51 into NVIDIA:main Jun 14, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jun 14, 2023
@bettinaheim bettinaheim added the release notes Changes need to be captured in the release notes label Jun 28, 2023
@amccaskey amccaskey deleted the pyLazyLoading branch September 13, 2023 23:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release notes Changes need to be captured in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants