Closed VicentePerezSoloviev closed 1 year ago
Made a diff and created a bogus props_rueschlikon.json
and it seems to work.
I don't have access to ibmq_rueschlikon
to make a better props file.
diff --git a/qiskit/test/mock/backends/rueschlikon/fake_rueschlikon.py b/qiskit/test/mock/backends/rueschlikon/fake_rueschlikon.py
index 306de8311..5ac0da332 100644
--- a/qiskit/test/mock/backends/rueschlikon/fake_rueschlikon.py
+++ b/qiskit/test/mock/backends/rueschlikon/fake_rueschlikon.py
@@ -13,8 +13,10 @@
"""
Fake Reuschlikon device (16 qubit).
"""
+import os
+import json
-from qiskit.providers.models import GateConfig, QasmBackendConfiguration
+from qiskit.providers.models import GateConfig, QasmBackendConfiguration, BackendProperties
from qiskit.test.mock.fake_backend import FakeBackend, FakeLegacyBackend
@@ -70,6 +72,14 @@ class FakeRueschlikon(FakeBackend):
super().__init__(configuration)
+ def properties(self):
+ """Returns a snapshot of device properties"""
+ dirname = os.path.dirname(__file__)
+ filename = "props_rueschlikon.json"
+ with open(os.path.join(dirname, filename)) as f_prop:
+ props = json.load(f_prop)
+ return BackendProperties.from_dict(props)
+
class FakeLegacyRueschlikon(FakeLegacyBackend):
"""A fake 16 qubit backend."""
@@ -122,3 +132,11 @@ class FakeLegacyRueschlikon(FakeLegacyBackend):
)
super().__init__(configuration)
+
+ def properties(self):
+ """Returns a snapshot of device properties"""
+ dirname = os.path.dirname(__file__)
+ filename = "props_melbourne.json"
+ with open(os.path.join(dirname, filename)) as f_prop:
+ props = json.load(f_prop)
+ return BackendProperties.from_dict(props)
If this type of simulator has no noise, what is the difference between this simulator and the state_vector one from Aer.
Fakebackends and simulators are not the same thing. Simulators can take a noise model from a backend, if there is one. Fakebackends do not perform simulations per se.
@VicentePerezSoloviev , would it help if you get a warning when a fake backend dont have a props_*.json
? Something like "Warning: FakeRueschlikon does not provide noise information"
HIi @1ucian0 and @jwoehr. When I realised this, was when I was executing a quantum-inspired approach in different Fakebackends. Others, were able to emulate noise and different behaviour were obtained when changing the Fakebackend. However, when I executed the approach with FakeRueschlikon, the behaviour was the same as for the state-vector simulator. When I entered in the code, I realised that the noise was equal to 0. Then, the doubt is if Rueschlikon really have no noise, which would be a very strange case. Anycase, if the noise is not updated, it could be a good idea to raise a Warning such as you propose so other people do not expend time with this issues. I can implement it if needed
I wont say no to somebody offering code :) that's my weakness :P
PRs are welcomed! Thanks Vicente!
It is done now. The intantiation of the class will raise a Warning remembering the user that this backend has no noise properties, as proposed by @1ucian0
It fails in the pull request for the Coverage report. What could be happening?
Sorry, I didn't see this before: I don't think it's an appropriate solution to raise a warning when a user simply instantiates a fake backend. If we're not actually supplying the full information for Rueschlikon, then the solution is more like "don't call it Rueschlikon" than to warn - there's nothing the user did wrong, so there shouldn't be a warning. If we can't supply enough information to make it a proper fake backend, I don't think we should have it.
Given our current position that fake backends are just for testing the provider interfaces, and that Rüschlikon was retired in 2018, I'm going to close this as stale now.
Information
What is the current behavior?
When using FakeRueschlikon fake simulator, exploring the simulator properties cannot find any type of noise. I have looked for the decoherence time, the cx, u1, u2, u3 error and nothing was found. I have done the same for other fake simulators, and I have found the errors.
Steps to reproduce the problem
I have designed a function to print the information. The following:
What is the expected behavior?
The function prints the information abount the simulator. If this type of simulator has no noise, what is the difference between this simulator and the state_vector one from Aer. The unique difference with the state_simulator, is the coupling_map. The state_vector one does not have coupling map.
Suggested solutions
The problem might be that the backend properties are not the real ones. The backend properties of other simulators are different.