-
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
Add calibrations with the TemplateOptimization #5752
Conversation
…assignment in QuantumCircuit.
…rations to a quantum circuit. * Created a new abstract base class CalibrationCreator that is given to CalibrationAdder - CalibrationCreator is capable of telling if it supports a given DAG node. - If a DAG node is supported then it can create a calibration for that node and taylored to the backend. * Created a child class of CalibrationCreator to build ZX schedules based on ECR gates. * Created the library zx templates which provides ZX-based templates for the TemplateOptimizer. * Added the method add_calibration to DAGCircuit. * Amended corresponding __init__ files.
* Fixed some lint errors. * Debuged zx templates and moved them to the circuit library.
* Fixed lint.
* Added template.
Co-authored-by: Lauren Capelluto <[email protected]>
Co-authored-by: Lauren Capelluto <[email protected]>
…creator in calibration_adder.py.
* Fixed minor bug.
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.
LGTM. I didn't look closely at the templates, but it seems like those are tested to be the identify, which should be sufficient, yes?
Yes, the templates are tested to be the identity. Since these are parametric it requires assigning a value to the parameter. In the tests this value is 0.2 which is not some special value such as pi/2. |
Co-authored-by: Ali Javadi-Abhari <[email protected]>
Summary
TemplateOptimization can be used to match templates in a quantum circuit and replace them with more efficient gate decompositions. This PR implements #5751 by providing a library of ZX-based templates and provides a new transpilation pass (named
CalibrationAdder
) to add the corresponding schedules (i.e. calibrations) generated from a subclass of the new abstract base classCalibrationCreator
.Details and comments
An illustrative example of this functionality can be run through the self contained code
The output of this code (see below) shows that there is a significant reduction in schedule duration when using the native ZX interaction of the backend. In this exmaple, the pulse schedule of the unitary is generated from the instruction schedule map of the backend.