pygsti.tools.matrixtools.approximate_matrix_log

pygsti.tools.matrixtools.approximate_matrix_log#

approximate_matrix_log(m, target_logm, target_weight=10.0, tol=1e-06)#

Construct an approximate logarithm of superoperator matrix m that is real and near the target_logm.

The equation m = exp( logM ) is allowed to become inexact in order to make logM close to target_logm. In particular, the objective function that is minimized is (where || indicates the 2-norm):

|exp(logM) - m|_1 + target_weight * ||logM - target_logm||^2

Parameters:
  • m (numpy array) – The superoperator matrix whose logarithm is taken

  • target_logm (numpy array) – The target logarithm

  • target_weight (float) – A weighting factor used to balance the exactness-of-log term with the closeness-to-target term in the optimized objective function. This value multiplies the latter term.

  • tol (float, optional) – Optimizer tolerance.

Returns:

logM – An matrix of the same shape as m.

Return type:

numpy array