pyGSTi
pyGSTi copied to clipboard
Method for Clifford RB to return gates-per-Clifford
There currently is not a method in the clifford RB implementation that returns the number of gates per clifford operation, which is relevant for mapping the per-clifford error rate estimated in RB to an approximate per-gate error rate.
@coreyostrove Do you remember exactly what your use case/intended solution for this looked like?
A recap of the relevant code path: The CliffordRBDesign
takes a list of depths
that passes those depths on to create_clifford_rb_circuit
, which samples the correct number of Cliffords and then uses a CompilationRules
object to convert it into native gates.
Given that, it seems like there are two things you could want:
- The
CliffordRBDesign
knows the number of Cliffords sampled, as well as the length of the circuit in the terms of native gates. This could give an average number of native gates per Clifford. - We could look up the number of native gates per Clifford from the
CompilationRules
object directly (which again are given as lengths of "compiled" circuits).
Depending on whether we wanted some sort of member function for CliffordRBDesign
or just a utility function may determine which strategy we want to take.
I was just the messenger for this one (iirc from a list of suggestions/requests brought up in an IRL roadmapping session). I believe @jordanh6 was the brainchild behind this (or else may recall who was) and may be able to provide some context.
For what is is worth, I think having both items 1 and 2 would likely be useful, but I don't personally have an articulated need readily in mind.
Fair enough. @jordanh6, any thoughts on this?
The reason I ask for more context is because both of these things are pretty easy to do, but not sure where the best spot to put them is, and that depends on their use case.
I don't recall suggesting this, so it was probably @tjproct.
In my opinion both of your solutions are reasonable, but I also don't have a use case in mind beyond what's in the initial comment (rescaling the RB error rate). I have personally used approximately solution (1) to rescale RB error rates before on 3+ qubits, where you'd really rather not check the compilation length of each n-qubit Clifford gate. However, I think the utility function described in (2) could be nice to have also.
Closing as this is merged in develop with #443.