pygsti.gram_rank_and_evals

pygsti.gram_rank_and_evals(dataset, specs, targetGateset=None, spamDict=None)

Returns the rank and singular values of the Gram matrix for a dataset.

Parameters:
  • dataset (DataSet) – The data used to populate the Gram matrix
  • specs (2-tuple) – A (prepSpecs,effectSpecs) tuple usually generated by calling build_spam_specs(...)
  • targetGateset (GateSet, optional) – A gateset used to specify the SPAM labels used to connect the dataset values to rhoVec and EVec indices.
  • spamDict (dictionary, optional) – Dictionary mapping (rhoVec_index,EVec_index) integer tuples to string spam labels. Defaults to the spam dictionary of targetGateset e.g. spamDict[(0,0)] == “plus”
Returns:

  • rank (int) – the rank of the Gram matrix
  • svalues (numpy array) – the singular values of the Gram matrix
  • svalues_target (numpy array) – the corresponding singular values of the Gram matrix generated by targetGateset. (or None if targetGateset is None)