Skip to content

Support sqrt(iSWAP) and Sycamore gates in Floquet calibration #4248

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

Merged
merged 10 commits into from
Jun 24, 2021

Conversation

fedimser
Copy link
Contributor

@fedimser fedimser commented Jun 21, 2021

Goal of this PR is that circuits having any of these 2-qubit gates (sqrt(iSWAP), Sycamore) can be calibrated on real hardware. In #4164 I ensured that any FSim-compatible gate can be handled on compensation phase. But on characterization step we can support only these 2 gates, because only they are implemented in hardware (so far).

For that:

  • Added method try_convert_syc_or_sqrt_iswap_to_fsim which is restriction of try_convert_gate_to_fsim on gates supported by hardware.
  • Used that method in workflow.py as gate translator everywhere where try_convert_sqrt_iswap_to_fsim was used.
  • Fixed a bug in _merge_into_calibrations so if there are calibrations for 2 different gates, it wouldn't fail with assertion error, but would append new calibration to the list of calibration.
  • Modified a test test_run_zeta_chi_gamma_calibration_for_moments so the circuit under test contains gates of 2 types.

@fedimser fedimser requested review from cduck, vtomole, wcourtney and a team as code owners June 21, 2021 22:03
@fedimser fedimser requested a review from tanujkhattar June 21, 2021 22:03
@google-cla google-cla bot added the cla: yes Makes googlebot stop complaining. label Jun 21, 2021
@mrwojtek mrwojtek self-requested a review June 22, 2021 13:34
@fedimser
Copy link
Contributor Author

fedimser commented Jun 24, 2021

Hi @mrwojtek! This PR is now ready to review.

I modified a test as we discussed, and it was failing on assertion in _merge_into_calibrations. I think these assertions were wrong because they were preventing us from having calibrations for 2 different gates. According to comment to that method if we can't merge new calibration with existing one, we should just append it to calibrations. So I replaced those assertions with continue. Now the modified test passes.

@fedimser fedimser changed the title Support sqrt(iSWAP), CZ and Sycamore gates in Floquet calibration Support sqrt(iSWAP) and Sycamore gates in Floquet calibration Jun 24, 2021
Copy link
Collaborator

@mrwojtek mrwojtek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this all seem fine!

You're right, the _merge_into_calibrations was not designed to support mixed calibrations before and your solution is good I think.

@fedimser
Copy link
Contributor Author

@balopat, can we please merge this?

@tanujkhattar tanujkhattar added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jun 24, 2021
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jun 24, 2021
@CirqBot CirqBot merged commit 09a2ea5 into quantumlib:master Jun 24, 2021
@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Jun 24, 2021
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
…mlib#4248)

Goal of this PR is that circuits having any of these 2-qubit gates (sqrt(iSWAP), Sycamore) can be calibrated on real hardware. In quantumlib#4164 I ensured that any FSim-compatible gate can be handled on compensation phase. But on characterization step we can support only these 2 gates, because only they are implemented in hardware (so far).

For that:
* Added method `try_convert_syc_or_sqrt_iswap_to_fsim` which is restriction of `try_convert_gate_to_fsim` on gates supported by hardware.
* Used that method in `workflow.py` as gate translator everywhere where `try_convert_sqrt_iswap_to_fsim` was used.
* Fixed a bug in `_merge_into_calibrations` so if there are calibrations for 2 different gates, it wouldn't fail with assertion error, but would append new calibration to the list of calibration.
* Modified a test `test_run_zeta_chi_gamma_calibration_for_moments` so the circuit under test contains gates of 2 types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Makes googlebot stop complaining.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants