-
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
Fake Backends don't pass options to underlying simulator #7500
Comments
I would like to work on this issue @mtreinish. Could you please complete what you observed in the "What is happening?" section? |
Assigned to you @bopardikarsoham! Remember to read the contributing guidelines and let us know if you have any questions! I think the unfinished sentence in "What is happening" is just a typo and there should be enough in the rest of the description for you to get started 😄 |
Hi @bopardikarsoham, I just wanted to ask about the progress you've made on this issue. I would like to try to solve it, but I wanted to check in with you first. @javabster |
Hello @VaibhavSanjay, I'm still working on the issue and need some more time. However, if I am unable to solve the issue, @javabster will assign it to you. |
Hello @bopardikarsoham, shall I assign it to @VaibhavSanjay ? |
Yes, you can @1ucian0. I'm not able to solve it. |
I believe I have a fix, could I get the issue assigned to me @1ucian0 ? |
assigning you @VaibhavSanjay. Thanks! |
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
* 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>
* 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]>
Environment
What is happening?
The options object from in the fake backends don't get passed down to the underlying simulator.
How can we reproduce the issue?
What should happen?
100 should print not 1024
Any suggestions?
In the
run()
method defined in https://github.com/Qiskit/qiskit-terra/blob/main/qiskit/test/mock/fake_backend.py#L118 we should copy self.options and set the internal simulator backend object's options attribute to be that copy. This will propagate any changes made by the user to the options to the underlying simulation when we call the internal simulator backend'srun()
method.The text was updated successfully, but these errors were encountered: