pyGSTi icon indicating copy to clipboard operation
pyGSTi copied to clipboard

Method for Clifford RB to return gates-per-Clifford

Open coreyostrove opened this issue 1 year ago • 4 comments

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 avatar May 18 '23 22:05 coreyostrove

@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:

  1. 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.
  2. 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.

sserita avatar Apr 02 '24 22:04 sserita

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.

coreyostrove avatar Apr 02 '24 23:04 coreyostrove

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.

sserita avatar Apr 02 '24 23:04 sserita

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.

jordanh6 avatar Apr 04 '24 05:04 jordanh6

Closing as this is merged in develop with #443.

sserita avatar Jun 01 '24 13:06 sserita