pygsti.tools.rbtheory.R_matrix#
- R_matrix(model, group, group_to_model=None, weights=None)#
Constructs a generalization of the ‘R-matrix’ of Proctor et al Phys. Rev. Lett. 119, 130502 (2017).
This matrix described the exact behaviour of the average success probabilities of RB sequences. This matrix is super-exponentially large in the number of qubits, but can be constructed for 1-qubit models.
- Parameters:
model (Model) – The noisy model (e.g., the Cliffords) to calculate the R matrix of. The corresponding target model (not required in this function) must be equal to or a subset of (a faithful rep of) the group group. If group_to_model `is None, the labels of the gates in model should be the same as the labels of the corresponding group elements in `group. For Clifford RB model should be the clifford model; for direct RB this should be the native model.
group (MatrixGroup) – The group that the model model contains gates from. For Clifford RB or direct RB, this would be the Clifford group.
group_to_model (dict, optional) – If not None, a dictionary that maps labels of group elements to labels of model. This is required if the labels of the gates in model are different from the labels of the corresponding group elements in group.
weights (dict, optional) – If not None, a dictionary of floats, whereby the keys are the gates in model and the values are the unnormalized probabilities to apply each gate at for each layer of the RB protocol. If None, the weighting defaults to an equal weighting on all gates, as used in most RB protocols (e.g., Clifford RB).
- Returns:
R – A weighted, a subset-sampling generalization of the ‘R-matrix’ from Proctor et al Phys. Rev. Lett. 119, 130502 (2017).
- Return type:
float