pygsti.io.StdInputParser.parse_dataline

StdInputParser.parse_dataline(s, lookup={}, expectedCounts=-1)

Parse a data line (dataline in grammar)

Parameters:
  • s (string) – The string to parse.
  • lookup (dict, optional) – A dictionary with keys == reflbls and values == tuples of gate labels which can be used for substitutions using the S<reflbl> syntax.
  • expectedCounts (int, optional) – The expected number of counts to accompany the gate string on this data line. If < 0, no check is performed; otherwise raises ValueError if the number of counts does not equal expectedCounts.
Returns:

  • gateStringTuple (tuple) – The gate string as a tuple of gate labels.
  • gateStringStr (string) – The gate string as represented as a string in the dataline
  • counts (list) – List of counts following the gate string.