Skip to content
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

What circuits the circuits method in RB experiments should return #930

Closed
itoko opened this issue Oct 3, 2022 · 2 comments
Closed

What circuits the circuits method in RB experiments should return #930

itoko opened this issue Oct 3, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@itoko
Copy link
Contributor

itoko commented Oct 3, 2022

What is the expected behavior?

What circuits should the circuits method in RB experiments return? Especially, should it return

  • circuits with wrapped or unwrapped Clifford operations? (or don't care?)
  • circuits with basis-transformed or not? (or don't care?)

Currently, the circuits method in StandardRB returns circuits with wrapped Clifford operations without basis transformation like this:

from qiskit_experiments.library.randomized_benchmarking import StandardRB
exp = StandardRB(qubits=(0,), lengths=[1, 2, 3], seed=12, backend=FakeManila())
print(exp.circuits()[1].draw())
         ░ ┌─────────────────┐ ░ ┌────────────────┐ ░ ┌──────────────────────────────────────────────────────┐ ░ ┌─┐
     q: ─░─┤ Clifford-1Q(14) ├─░─┤ Clifford-1Q(6) ├─░─┤ Clifford: Stabilizer = ['-Y'], Destabilizer = ['-X'] ├─░─┤M├
         ░ └─────────────────┘ ░ └────────────────┘ ░ └──────────────────────────────────────────────────────┘ ░ └╥┘
meas: 1/══════════════════════════════════════════════════════════════════════════════════════════════════════════╩═
                                                                                                                  0 

You can see the decomposed circuits with one more method call:

print(exp.circuits()[1].decompose("Clifford*").draw())
         ░ ┌──────┐┌───┐ ░ ┌───┐ ░ ┌───┐┌───┐┌───┐┌───┐ ░ ┌─┐
     q: ─░─┤ √Xdg ├┤ Y ├─░─┤ X ├─░─┤ Y ├┤ S ├┤ H ├┤ S ├─░─┤M├
         ░ └──────┘└───┘ ░ └───┘ ░ └───┘└───┘└───┘└───┘ ░ └╥┘
meas: 1/═══════════════════════════════════════════════════╩═
                                                           0 

FYI: You can see the transpiled circuits (basis-transformed and applied mapping to physical qubits) by

print(exp._transpiled_circuits()[1].draw(idle_wires=False))
global phase: 5π/4
          ░ ┌─────────┐┌─────────┐┌────┐┌─────────┐┌─────────┐┌─────────┐┌────┐┌────────┐┌────┐┌──────────┐ ░ ┌───┐ ░ »
q_0 -> 0 ─░─┤ Rz(π/2) ├┤ Rz(π/2) ├┤ √X ├┤ Rz(π/2) ├┤ Rz(π/2) ├┤ Rz(π/2) ├┤ √X ├┤ Rz(2π) ├┤ √X ├┤ Rz(7π/2) ├─░─┤ X ├─░─»
          ░ └─────────┘└─────────┘└────┘└─────────┘└─────────┘└─────────┘└────┘└────────┘└────┘└──────────┘ ░ └───┘ ░ »
 meas: 1/═════════════════════════════════════════════════════════════════════════════════════════════════════════════»
                                                                                                                      »
«         ┌─────────┐┌────┐┌────────┐┌────┐┌──────────┐┌─────────┐┌─────────┐┌────┐┌─────────┐┌─────────┐ ░ ┌─┐
«q_0 -> 0 ┤ Rz(π/2) ├┤ √X ├┤ Rz(2π) ├┤ √X ├┤ Rz(7π/2) ├┤ Rz(π/2) ├┤ Rz(π/2) ├┤ √X ├┤ Rz(π/2) ├┤ Rz(π/2) ├─░─┤M├
«         └─────────┘└────┘└────────┘└────┘└──────────┘└─────────┘└─────────┘└────┘└─────────┘└─────────┘ ░ └╥┘
« meas: 1/═══════════════════════════════════════════════════════════════════════════════════════════════════╩═
«                                                                                                            0 

I would like to hear from many users about what the circuits should returns.

  1. Circuits with wrapped Cliffords without basis transformation (Current spec)
  2. Circuits with wrapped Cliffords with basis transformation
  3. Circuits with unwrapped Cliffords without basis transformation
  4. Circuits with unwrapped Cliffords with basis transformation
  5. Other?

Which one do you expect?

@itoko itoko added the enhancement New feature or request label Oct 3, 2022
@itoko
Copy link
Contributor Author

itoko commented Oct 6, 2022

I prefer 2 or 4.

@itoko
Copy link
Contributor Author

itoko commented Oct 18, 2023

Settle down to (2) Circuits with wrapped Cliffords with basis transformation once at #982

@itoko itoko closed this as completed Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant