-
Notifications
You must be signed in to change notification settings - Fork 160
Interleaved RB option to keep the original interleaved element #548
Interleaved RB option to keep the original interleaved element #548
Conversation
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.
Thanks @gadial for the patch! This looks good to me. Just minor comment.
@@ -202,6 +211,7 @@ def randomized_benchmarking_seq(nseeds: int = 1, | |||
Union[List[QuantumCircuit], List[Instruction], | |||
List[qiskit.quantum_info.operators.symplectic.Clifford], | |||
List[CNOTDihedral]]] = None, | |||
keep_original_interleaved_elem: Optional[bool] = False, |
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.
Can this default to True
to reproduce conventional behavior?
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.
The current behavior of RB is to convert the interleaved element to the group representation, which is what happens when keep_original_interleaved_elem == False
. I wish to keep it default in order to avoid impacting existing code.
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.
I'm now convinced that True
is the correct default value, although it will require to pass False
explicitly to the existing tests.
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. Thanks @gadial !
This PR adds a boolean switch
keep_original_interleaved_elem
to therandomized_benchmarking_seq
circuit generator of randomized benchmarking.Currently, the generator obtains an element to interleave, converts it to a group element, obtains a circuit representation of that element and adds it to the RB circuit. This usually results in a change even if the original element was a single instruction (e.g.
SwapGate
object will be converted to circuit comprising ofCX
gates).If
keep_original_interleaved_elem == True
, the original instruction/circuit is retained and used in the circuit as is. The code still needs to be able to convert it to a group element in order to invert the circuit at the end, and so the switch does not enable one to use non-group gates (e.g. usingT
gate for the Clifford group).Summary
Details and comments