Fake Backends don't pass options to underlying simulator
See original GitHub issueEnvironment
- Qiskit Terra version: 0.19.x (and main)
- Python version: 3.10
- Operating system: linux
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?
from qiskit.circuit import QuantumCircuit
from qiskit import execute
from qiskit.test.mock import FakeQuito
backend = FakeQuito()
circuit = QuantumCircuit(2)
circuit.h(0)
circuit.cx(0, 1)
circuit.measure_all()
backend.set_options(shots=100)
job = execute(circuit, backend)
result = job.result()
counts = result.get_counts()
print(sum(counts.values())
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’s run()
method.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
AerSimulator - Qiskit
Configurable Options. The AerSimulator supports multiple simulation methods and configurable options for each simulation method. · Simulating an IBMQ Backend.
Read more >Running on Backends — pytket-manual documentation
Each Backend object is aware of the restrictions of the underlying device or simulator, encoding them as a collection of Predicate s.
Read more >Source code for snntoolbox.simulation.backends.inisim.ttfs
coding: utf-8 -*- """INI time-to-first-spike simulator backend. This module defines the layer objects used to create a spiking neural network for our ...
Read more >caf.backends — basf2 release-06-00-03 documentation
args = tuple() # If our generator finishes before the subjobs we use empty argument tuples generating = False else: args = tuple()...
Read more >CLI Arguments - Appium
Flag Default Description
‑‑shell null Enter REPL mode
‑‑ipa null (IOS‑only) abs path to compiled .ipa file
‑a , ‑‑address 0.0.0.0 IP Address to listen on...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 😄
assigning you @VaibhavSanjay. Thanks!