-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 ECR gate and approximation_degree option #5609
Conversation
21597ad
to
5b9fa5a
Compare
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.
Looks good, two small test comments, but otherwise, good to go.
"Synthesis fidelity" is not a good description of the parameter. "Basis fidelity" is better. The actual meaning of the parameter is that it assumes each use of the 2-qubit basis gate has the given gate fidelity, and trades that off with the approximation fidelity. For example if the target gate is the small fractional SWAP exp(0.0647 i (xx+yy+zz)) then with basis_fidelity=0.9966 the decomposer will prefer the 0.99 gate fidelity 0-CNOT product decomposition in preference to the perfect 3-CNOT decomposition, whereas in this case I would say the "synthesis fidelity" is 0.9900 |
Yes but I wanted to somehow avoid making this too specific to this pass. I'm trying to add a knob to the high-level "transpile" command that allows users to control approximation degree. You can imagine this knob can be useful in things like compiling to a discrete gate set, or using approximate QFT, or whatnot. I know this particular pass makes its approximation decision based on finding a sweet spot in the tradeoff between applying more gates and fidelity of synthesis. So I'd be open to suggestions for a general name. Would "approximation_degree" be good? |
Wouldn't finding a sweet spot between gates fidelity and synthesis fidelity be fairly generic also to things like Solovay-Kitaev or whatever? I would argue that some interpretation basis_fidelity could/should be used in many/most circumstances. |
…ks emits unitaries
Ok I think I understand what you mean. You're saying the minimum basis fidelity that would make a difference to your approximation is basis_gate of 0.4 fidelity. That's even though the approximation itself can go lower than 0.4 in the Weyl chamber:
I'm happy to do whatever you prefer here. I do want to make a follow up PR where I make the |
After optimizing over single-qubit pre/post rotation |
perhaps the right thing is to require that approximation-aware synthesis methods expose an |
Yes I think something like that makes sense, a pass-specific parameter and a generic parameter that can be mapped to that for each pass. I can do this for the 2-qubit synthesizer in the follow-up PR. |
* Prepare 0.17.0 release To prepare for the upcoming 0.17.0 release this commit moves all the release notes into a 0.17 subdirectory to keep them separate from future development notes post-release. It also adds an incomplete release note to add the prelude section providing the high level overview of the release. When this merges it should be the commit used to tag the 0.17.0 release. * Add feature note for aqua migrated modules * Update release notes abd add piecewise chebyshev to docs and library export * Update more release notes and add abstract pass classes to docs * More release note updates * Update more release notes and add clifford_decompose to api docs * Add RZXCalibration pass and templates to docs and update release notes * Update more release notes * Fix typo in decompose_clifford imports and release notes * Fix docs build * Add hellinger_distance to docs * Add RZXCalibrationBuilder to the docs * More release note updates * Fix import error * Fix RZXCalibrationBuilder docstring * Finish updating the new feature release notes * Fix lint * Apply suggestions from code review Co-authored-by: Julien Gacon <gaconju@gmail.com> * Move new release notes to 0.17 dir and update * Fix RVGate docs and start updating upgrade notes * Fix PauliGate example circuit visualization * Fix typo * More release note updates * Update meas_map release note again * Fix whitespace in meas_map release note * Fix docs build * Update almost all of the upgrade notes * Add latex to docs job env * Revert "Add latex to docs job env" This reverts commit 8080cb5. * Remove latex drawing from the release notes Getting the texlive distribution with qcircuit installed in CI is proving problematic in the interest of time and finishing the other releasenotes instead of relying on it this just changes the latex drawer jupyter execute to be a code block and not depend on being able to run pdftlatex at docs build time. * Remove fix note for unreleased feature * Move and update new release notes * Remove unnecessary upgrade note about internal API changes * More release note updates * More release note updates * Even more release note updates * Fix syntax error * Fix docs build * Move new release notes and fix docs issues from #5609 * Update more release notes * Move new release notes * More release note updates * Finish fixes notes * Fix docs build * Update more relaese notes * Apply suggestions from code review Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * More note fixes * Update new release notes * Apply suggestions from code review Co-authored-by: Kevin Krsulich <kevin@krsulich.net> * Move and update new release notes * Apply suggestions from code review Co-authored-by: Kevin Krsulich <kevin@krsulich.net> * cleaning up docs for vqe * clean up extend * Fix reno merge commit error * Revert accidental tox.ini change * Tweak release note wording * Move and update new release notes * Attempt to retrigger azure Co-authored-by: Julien Gacon <gaconju@gmail.com> Co-authored-by: Lauren Capelluto <laurencapelluto@gmail.com> Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: Kevin Krsulich <kevin@krsulich.net> Co-authored-by: Jay Gambetta <jay.gambetta@us.ibm.com>
* Prepare 0.17.0 release To prepare for the upcoming 0.17.0 release this commit moves all the release notes into a 0.17 subdirectory to keep them separate from future development notes post-release. It also adds an incomplete release note to add the prelude section providing the high level overview of the release. When this merges it should be the commit used to tag the 0.17.0 release. * Add feature note for aqua migrated modules * Update release notes abd add piecewise chebyshev to docs and library export * Update more release notes and add abstract pass classes to docs * More release note updates * Update more release notes and add clifford_decompose to api docs * Add RZXCalibration pass and templates to docs and update release notes * Update more release notes * Fix typo in decompose_clifford imports and release notes * Fix docs build * Add hellinger_distance to docs * Add RZXCalibrationBuilder to the docs * More release note updates * Fix import error * Fix RZXCalibrationBuilder docstring * Finish updating the new feature release notes * Fix lint * Apply suggestions from code review Co-authored-by: Julien Gacon <gaconju@gmail.com> * Move new release notes to 0.17 dir and update * Fix RVGate docs and start updating upgrade notes * Fix PauliGate example circuit visualization * Fix typo * More release note updates * Update meas_map release note again * Fix whitespace in meas_map release note * Fix docs build * Update almost all of the upgrade notes * Add latex to docs job env * Revert "Add latex to docs job env" This reverts commit 8080cb5. * Remove latex drawing from the release notes Getting the texlive distribution with qcircuit installed in CI is proving problematic in the interest of time and finishing the other releasenotes instead of relying on it this just changes the latex drawer jupyter execute to be a code block and not depend on being able to run pdftlatex at docs build time. * Remove fix note for unreleased feature * Move and update new release notes * Remove unnecessary upgrade note about internal API changes * More release note updates * More release note updates * Even more release note updates * Fix syntax error * Fix docs build * Move new release notes and fix docs issues from Qiskit#5609 * Update more release notes * Move new release notes * More release note updates * Finish fixes notes * Fix docs build * Update more relaese notes * Apply suggestions from code review Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * More note fixes * Update new release notes * Apply suggestions from code review Co-authored-by: Kevin Krsulich <kevin@krsulich.net> * Move and update new release notes * Apply suggestions from code review Co-authored-by: Kevin Krsulich <kevin@krsulich.net> * cleaning up docs for vqe * clean up extend * Fix reno merge commit error * Revert accidental tox.ini change * Tweak release note wording * Move and update new release notes * Attempt to retrigger azure Co-authored-by: Julien Gacon <gaconju@gmail.com> Co-authored-by: Lauren Capelluto <laurencapelluto@gmail.com> Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: Kevin Krsulich <kevin@krsulich.net> Co-authored-by: Jay Gambetta <jay.gambetta@us.ibm.com>
* Prepare 0.17.0 release To prepare for the upcoming 0.17.0 release this commit moves all the release notes into a 0.17 subdirectory to keep them separate from future development notes post-release. It also adds an incomplete release note to add the prelude section providing the high level overview of the release. When this merges it should be the commit used to tag the 0.17.0 release. * Add feature note for aqua migrated modules * Update release notes abd add piecewise chebyshev to docs and library export * Update more release notes and add abstract pass classes to docs * More release note updates * Update more release notes and add clifford_decompose to api docs * Add RZXCalibration pass and templates to docs and update release notes * Update more release notes * Fix typo in decompose_clifford imports and release notes * Fix docs build * Add hellinger_distance to docs * Add RZXCalibrationBuilder to the docs * More release note updates * Fix import error * Fix RZXCalibrationBuilder docstring * Finish updating the new feature release notes * Fix lint * Apply suggestions from code review Co-authored-by: Julien Gacon <gaconju@gmail.com> * Move new release notes to 0.17 dir and update * Fix RVGate docs and start updating upgrade notes * Fix PauliGate example circuit visualization * Fix typo * More release note updates * Update meas_map release note again * Fix whitespace in meas_map release note * Fix docs build * Update almost all of the upgrade notes * Add latex to docs job env * Revert "Add latex to docs job env" This reverts commit 8080cb58ea0c0faad270197c61d2cececff8da1e. * Remove latex drawing from the release notes Getting the texlive distribution with qcircuit installed in CI is proving problematic in the interest of time and finishing the other releasenotes instead of relying on it this just changes the latex drawer jupyter execute to be a code block and not depend on being able to run pdftlatex at docs build time. * Remove fix note for unreleased feature * Move and update new release notes * Remove unnecessary upgrade note about internal API changes * More release note updates * More release note updates * Even more release note updates * Fix syntax error * Fix docs build * Move new release notes and fix docs issues from Qiskit/qiskit#5609 * Update more release notes * Move new release notes * More release note updates * Finish fixes notes * Fix docs build * Update more relaese notes * Apply suggestions from code review Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * More note fixes * Update new release notes * Apply suggestions from code review Co-authored-by: Kevin Krsulich <kevin@krsulich.net> * Move and update new release notes * Apply suggestions from code review Co-authored-by: Kevin Krsulich <kevin@krsulich.net> * cleaning up docs for vqe * clean up extend * Fix reno merge commit error * Revert accidental tox.ini change * Tweak release note wording * Move and update new release notes * Attempt to retrigger azure Co-authored-by: Julien Gacon <gaconju@gmail.com> Co-authored-by: Lauren Capelluto <laurencapelluto@gmail.com> Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: Kevin Krsulich <kevin@krsulich.net> Co-authored-by: Jay Gambetta <jay.gambetta@us.ibm.com>
Adds a new 2-qubit gate, the echo cross-resonance (ECR), which is two CR(π/4) pulses with an X gate between them for the echo. This gate is locally equivalent to a CNOT (can convert to a CNOT with local pre- or post-rotation). It is the native gate on current IBM hardware and compiling to it allows the pre-/post-rotations to be merged into the rest of the circuit.
Additionally a new option is added to the transpiler for approximate synthesis of unitaries. The synthesis fidelity can be given to the transpiler. This capability was already there in the synthesizer, it is just now exposed to the transpiler.