-
Notifications
You must be signed in to change notification settings - Fork 31
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
♻️ BackendV2 migration of MQT DDSIM Qiskit backends #267
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #267 +/- ##
=======================================
+ Coverage 91.7% 92.5% +0.7%
=======================================
Files 31 32 +1
Lines 2475 2538 +63
Branches 351 351
=======================================
+ Hits 2272 2349 +77
+ Misses 203 189 -14
*This pull request uses carry forward flags. Click here to find out more.
|
Thank you very much for creating the PR! Can you apply the changes directly to |
Hi |
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.
Thanks for your quick response. It's a bit unfortunate that qiskit itself does not use BackendV2
yet in their standard backends, but they do have in in their fake backends.
Could take a look on into the above implementation and the migration guide to add the missing functions/members so the functionality remains the same and the tests pass?
@andresbar98 you might want to have a look at https://github.com/qiskit-community/qiskit-aqt-provider/tree/master |
…ends as methods, which caused errors
Hey @andresbar98 👋🏼
Please have a look through these changes and see whether they make sense to you. |
mqt/ddsim/hybridqasmsimulator.py
Outdated
|
||
def __init__(self) -> None: | ||
super().__init__() | ||
self.name = "hybrid_qasm_simulator" |
Check warning
Code scanning / CodeQL
Overwriting attribute in super-class or sub-class
mqt/ddsim/hybridqasmsimulator.py
Outdated
def __init__(self) -> None: | ||
super().__init__() | ||
self.name = "hybrid_qasm_simulator" | ||
self.description = ("MQT DDSIM Hybrid Schrodinger-Feynman simulator",) |
Check warning
Code scanning / CodeQL
Overwriting attribute in super-class or sub-class
super().__init__(configuration=configuration or BackendConfiguration.from_dict(conf), provider=provider) | ||
def __init__(self) -> None: | ||
super().__init__() | ||
self.name = "hybrid_statevector_simulator" |
Check warning
Code scanning / CodeQL
Overwriting attribute in super-class or sub-class
def __init__(self) -> None: | ||
super().__init__() | ||
self.name = "hybrid_statevector_simulator" | ||
self.description = "MQT DDSIM Hybrid Schrodinger-Feynman Statevector simulator" |
Check warning
Code scanning / CodeQL
Overwriting attribute in super-class or sub-class
mqt/ddsim/pathqasmsimulator.py
Outdated
|
||
def __init__(self) -> None: | ||
super().__init__() | ||
self.name = "path_sim_qasm_simulator" |
Check warning
Code scanning / CodeQL
Overwriting attribute in super-class or sub-class
mqt/ddsim/pathqasmsimulator.py
Outdated
def __init__(self) -> None: | ||
super().__init__() | ||
self.name = "path_sim_qasm_simulator" | ||
self.description = "MQT DDSIM Simulation Path Framework" |
Check warning
Code scanning / CodeQL
Overwriting attribute in super-class or sub-class
mqt/ddsim/statevectorsimulator.py
Outdated
super().__init__(configuration=configuration or BackendConfiguration.from_dict(conf), provider=provider) | ||
def __init__(self) -> None: | ||
super().__init__() | ||
self.name = "statevector_simulator" |
Check warning
Code scanning / CodeQL
Overwriting attribute in super-class or sub-class
mqt/ddsim/statevectorsimulator.py
Outdated
def __init__(self) -> None: | ||
super().__init__() | ||
self.name = "statevector_simulator" | ||
self.description = "MQT DDSIM Statevector Simulator" |
Check warning
Code scanning / CodeQL
Overwriting attribute in super-class or sub-class
mqt/ddsim/unitarysimulator.py
Outdated
|
||
def __init__(self) -> None: | ||
super().__init__() | ||
self.name = "unitary_simulator" |
Check warning
Code scanning / CodeQL
Overwriting attribute in super-class or sub-class
mqt/ddsim/unitarysimulator.py
Outdated
def __init__(self) -> None: | ||
super().__init__() | ||
self.name = "unitary_simulator" | ||
self.description = "MQT DDSIM Unitary Simulator" |
Check warning
Code scanning / CodeQL
Overwriting attribute in super-class or sub-class
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
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.
CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
… method in Unitarysimulator
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.
I think we finally have it. At least close to it. See the suggestions below. That should make the tests pass. Everything else can then be put into the issue you just created.
Co-authored-by: Lukas Burgholzer <burgholzer@me.com>
Co-authored-by: Lukas Burgholzer <burgholzer@me.com>
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.
This LGTM now 👍🏼 Many thanks for this contribution!
Just waiting for CI to run through ✅
Migrating all MQT simulators from BackendV1 to BackendV2.
Besides different access patterns I also eliminated some intermediate steps that involved dealing with QasmQobj and QasmQobjExperiment classes, since those are deprecated. Now we will be dealing with QuantumCircuit objects only.