pygsti.tools.errgenproptools.errorgen_layer_to_matrix#
- errorgen_layer_to_matrix(errorgen_layer, num_qubits, errorgen_matrix_dict=None, sslbls=None)#
Converts an iterable over error generator coefficients and rates into the corresponding dense numpy array representation.
- Parameters:
errorgen_layer (list, tuple or dict) – An iterable over error generator coefficient and rates. If a list or a tuple the elements should correspond to two-element tuples, the first value being an ElementaryErrorgenLabel and the second value the rate. If a dictionary the keys should be ElementaryErrorgenLabel and the values the rates.
num_qubits (int) – Number of qubits for the error generator matrix being constructed.
errorgen_matrix_dict (dict, optional (default None)) – An optional dictionary mapping `ElementaryErrorgenLabel`s to numpy arrays for their dense representation. If not specified this will be constructed from scratch each call, so specifying this can provide a performance benefit.
sslbls (list or tuple, optional (default None)) – A tuple or list of state space labels corresponding to the qubits upon which the error generators can supported. Only required when passing in a value of errorgen_matrix_dict with GlobalElementaryErrogenLabel keys in conjunction with an errorgen_layer with labels which are LocalElementaryErrorgenLabel (or vice-versa).
- Returns:
errorgen_mat – ndarray for the dense representation of the specified error generator in the standard basis.
- Return type:
ndarray