-
Notifications
You must be signed in to change notification settings - Fork 8
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
Transpiler integration refactor and qiskit v1.2 support #116
base: main
Are you sure you want to change the base?
Conversation
…pile_to_IQM broke here.
I pushed my changes in case someone wants to pick it up next week. I'll be back on the 12th. The main framework is set up, but the tests are currently failing because of some stupid bugs that are hard to find:
|
CHANGELOG.rst
Outdated
* Refactoring of the Qiskit transpiler: | ||
* The Qiskit transpiler now automatically uses the :class:`IQMOptimizeSingleQubitGates` pass to optimize single-qubit gates if the `optimization_level >= 0`. | ||
* You can now use the native Qiskit :meth:`transpile` method to transpile a circuit to the IQM Deneb backend as long as your circuit does not contain any resonators. | ||
* There are many new transpiler plugins available that you can use as the `scheduling_method` argument in Qiskit's :meth:`transpile` method. You can find them in following the `Qiskit documentation <https://docs.quantum.ibm.com/guides/transpiler-plugins>`_. |
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.
Only scheduling_method
? What about the other *_method args?
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.
The plugins are only registered as scheduling_method
because they make assumptions about how much the circuit has been transpiled already. You can still combine them with the other transpiler args.
You could make our own optimization plugin or routing plugin, but that would be exposed to the user as a string making them overwrite the existing transpiler and making it impossible to augment it with an existing pass. So they would need to defined with an existing optimization/routing pass and we need a new class for each or combination of passes we want to support. That's not maintainable.
sorted(arch.qubits, key=_component_sort_key) | ||
+ sorted(arch.computational_resonators, key=_component_sort_key) |
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.
These are already sorted in the DQA.
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.
You sure? The sorting was already there
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.
There is an old unittests that checks if the qubits names are properly sorted. i.e. tests/test_iqm_backend_base.py:test_qubit_name_to_index_to_qubit_name
def has_resonators(self) -> bool: | ||
"""Return whether the backend has resonators.""" | ||
return bool(self.architecture.computational_resonators) |
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.
Is this needed? Can't the user just look at backend.architecture?
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.
They need to know that they can find it there. That's quite some archeology
Minimal refactor of
transpile_to_IQM
to support qiskit v1.2.Part of COMP-1361
Task list:
IQMBackendBase
to use instead of BackenPropertiesOther changes:
create_run_request
to improve the experience when using different run options, by making them explicit arguments that our documentation can refer tocreate_run_request
documentation to avoid out-dated duplicated information.qubit_name_to_idx
andidx_to_qubit_name
inIQMBackendBase
to no longer return Optional, but raise an error when the name or index cannot be found. This improved mypy and pylint issues as well as user experience since these functions should never be called in a way that it would return None.