Skip to content

(2/2) Add parameter sweep support for Pauli string measurements with readout mitigation #7569

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ddddddanni
Copy link
Contributor

Previous PR is #7435
This PR allow user to run measuring_pauli_strings in sweep mode. In this mode, the function uses parameterized circuits and sweeps parameters for both Pauli measurements and readout benchmarking

@ddddddanni ddddddanni marked this pull request as ready for review August 14, 2025 03:31
@ddddddanni ddddddanni requested review from vtomole and a team as code owners August 14, 2025 03:31
@ddddddanni ddddddanni requested a review from maffoo August 14, 2025 03:31
@eliottrosenberg eliottrosenberg self-requested a review August 14, 2025 16:23
Copy link
Collaborator

@eliottrosenberg eliottrosenberg left a comment

Choose a reason for hiding this comment

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

I tested this on hardware, and it seems to have a bug. For example, compare the last line of the output of this cell to the output of this cell. result and result2 come from the couple of cells above those. Reproduced again futher down in that colab.

Copy link
Collaborator

@eliottrosenberg eliottrosenberg left a comment

Choose a reason for hiding this comment

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

Ok, I found the difference. If you start with the following circuit:

0: ───────────────────────H───@───H───
                              │
1: ───────────────H───@───H───@───────
                      │
2: ───H───────@───H───@───────────────
              │
3: ───H───@───@───────────────────────
          │
4: ───H───@───────H───@───────────────
                      │
5: ───────────────H───@───H───@───────
                              │
6: ───────────────────────H───@───H───

and then measure X(q(0))*X(q(1))*X(q(2))*X(q(3))*X(q(4))*X(q(5))*X(q(6)), the sweep version gives you

0: ───────────────────────H───@───H───PhX(phi0/2 - 1/2)^theta0───M('m')───
                              │                                  │
1: ───────────────H───@───H───@───────PhX(phi1/2 - 1/2)^theta1───M────────
                      │                                          │
2: ───H───────@───H───@───────────────PhX(phi2/2 - 1/2)^theta2───M────────
              │                                                  │
3: ───H───@───@───────────────────────PhX(phi3/2 - 1/2)^theta3───M────────
          │                                                      │
4: ───H───@───────H───@───────────────PhX(phi4/2 - 1/2)^theta4───M────────
                      │                                          │
5: ───────────────H───@───H───@───────PhX(phi5/2 - 1/2)^theta5───M────────
                              │                                  │
6: ───────────────────────H───@───H───PhX(phi6/2 - 1/2)^theta6───M────────

with the basis change all in the same moment, whereas in the batch version, you get

0: ───────────────────────────────H───────────@───H───────────Ry(-0.5π)───M('m')───
                                              │                           │
1: ───────────────H───────────@───H───────────@───Ry(-0.5π)───────────────M────────
                              │                                           │
2: ───H───────@───H───────────@───Ry(-0.5π)───────────────────────────────M────────
              │                                                           │
3: ───H───@───@───Ry(-0.5π)───────────────────────────────────────────────M────────
          │                                                               │
4: ───H───@───────H───────────@───Ry(-0.5π)───────────────────────────────M────────
                              │                                           │
5: ───────────────H───────────@───H───────────@───Ry(-0.5π)───────────────M────────
                                              │                           │
6: ───────────────────────────────H───────────@───H───────────Ry(-0.5π)───M────────

with the basis change done as early as possible. In this case, you get a higher-fidelity result with the basis change done as early as possible because you are insensitive to the dephasing that happens between the final basis change gate and the measurement, but that may not always be the intended behavior. Maybe we could add an insert_strategy argument so that users have the choice of whether to do the basis change all in the same penultimate moment or as early as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: L 250< lines changed <1000
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants