pygsti.tools.optools.error_generator#
- error_generator(gate, target_op, mx_basis, typ='logG-logT', logG_weight=None)#
Construct the error generator from a gate and its target.
Computes the value of the error generator given by errgen = log( inv(target_op) * gate ), so that gate = target_op * exp(errgen).
- Parameters:
gate (ndarray) – The operation matrix
target_op (ndarray) – The target operation matrix
mx_basis ({'std', 'gm', 'pp', 'qt'} or Basis object) – The source and destination basis, respectively. Allowed values are Matrix-unit (std), Gell-Mann (gm), Pauli-product (pp), and Qutrit (qt) (or a custom basis object).
typ ({"logG-logT", "logTiG", "logGTi"}) –
The type of error generator to compute. Allowed values are:
”logG-logT” : errgen = log(gate) - log(target_op)
”logTiG” : errgen = log( dot(inv(target_op), gate) )
”logGTi” : errgen = log( dot(gate,inv(target_op)) )
logG_weight (float or None (default)) – Regularization weight for logG-logT penalty of approximate logG. If None, the default weight in
approximate_matrix_log()is used. Note that this will result in a logG close to logT, but G may not exactly equal exp(logG). If self-consistency with func:operation_from_error_generator is desired, consider testing lower (or zero) regularization weight.
- Returns:
errgen – The error generator.
- Return type:
ndarray