pygsti.tools.mx_to_string

pygsti.tools.mx_to_string(m, width=9, prec=4)

Generate a “pretty-format” string for a matrix.

Will generate strings for real or complex matrices with a desired precision and “cell” width.

Parameters:
  • mx (numpy array) – the matrix (2-D array) to convert.
  • width (int, opitonal) – the width (in characters) of each converted element
  • prec (int optional) – the precision (in characters) of each converted element
Returns:

matrix m as a pretty formated string.

Return type:

string