-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Store simulator Backend in FakeBackend instance #7912
Store simulator Backend in FakeBackend instance #7912
Conversation
This commit updates the FakeBackend and FakeBackendV2 classes (FakeLegacyBackend is being removed in Qiskit#7886) to only build a noise model from the stored properties one. This is done by initializing the internal simulator object only once at storing it as an instance attribute. The noise model is then constructed once at object initialization and used to update the backend at the same time. Fixes Qiskit#7500 Fixes Qiskit#7911
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the the following people are requested to review this:
|
This commit fixes another regression introduced in the previous commit around the import and __init__ performance of fake backends. By parsing the properties payload and creating a noise model we significantly slowed down the initialization of fake backend objects. This commit fixes this by ensuring we are lazy loading the noise model and simulator object creation as well as not parsing the properties (or defaults) payloads until we actually need them.
Pull Request Test Coverage Report for Build 2186799126
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
* Initialize simulator at FakeBackend inititialization This commit updates the FakeBackend and FakeBackendV2 classes (FakeLegacyBackend is being removed in #7886) to only build a noise model from the stored properties one. This is done by initializing the internal simulator object only once at storing it as an instance attribute. The noise model is then constructed once at object initialization and used to update the backend at the same time. Fixes #7500 Fixes #7911 * Lazy load simulator backend objects and properties This commit fixes another regression introduced in the previous commit around the import and __init__ performance of fake backends. By parsing the properties payload and creating a noise model we significantly slowed down the initialization of fake backend objects. This commit fixes this by ensuring we are lazy loading the noise model and simulator object creation as well as not parsing the properties (or defaults) payloads until we actually need them. * Use qubit properties in target for backendv2 * Filter all noise model warnings Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit 57f16ab)
* Initialize simulator at FakeBackend inititialization This commit updates the FakeBackend and FakeBackendV2 classes (FakeLegacyBackend is being removed in #7886) to only build a noise model from the stored properties one. This is done by initializing the internal simulator object only once at storing it as an instance attribute. The noise model is then constructed once at object initialization and used to update the backend at the same time. Fixes #7500 Fixes #7911 * Lazy load simulator backend objects and properties This commit fixes another regression introduced in the previous commit around the import and __init__ performance of fake backends. By parsing the properties payload and creating a noise model we significantly slowed down the initialization of fake backend objects. This commit fixes this by ensuring we are lazy loading the noise model and simulator object creation as well as not parsing the properties (or defaults) payloads until we actually need them. * Use qubit properties in target for backendv2 * Filter all noise model warnings Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit 57f16ab) Co-authored-by: Matthew Treinish <[email protected]>
Summary
This commit updates the FakeBackend and FakeBackendV2 classes
(FakeLegacyBackend is being removed in #7886) to only build a noise
model from the stored properties one. This is done by initializing the
internal simulator object only once at storing it as an instance
attribute. The noise model is then constructed once at object
initialization and used to update the backend at the same time.
Details and comments
Fixes #7500
Fixes #7911