pygsti.io.readers.read_dataset

Contents

pygsti.io.readers.read_dataset#

read_dataset(filename, cache=False, collision_action='aggregate', record_zero_counts=True, ignore_zero_count_lines=True, with_times='auto', circuit_parse_cache=None, verbosity=1)#

Load a DataSet from a file.

This function first tries to load file as a saved DataSet object, then as a standard text-formatted DataSet.

Parameters:
  • filename (string) – The name of the file

  • cache (bool, optional) – When set to True, a pickle file with the name filename + “.cache” is searched for and loaded instead of filename if it exists and is newer than filename. If no cache file exists or one exists but it is older than filename, a cache file will be written after loading from filename.

  • collision_action ({"aggregate", "keepseparate"}) – Specifies how duplicate circuits should be handled. “aggregate” adds duplicate-circuit counts, whereas “keepseparate” tags duplicate circuits by setting their .occurrence IDs to sequential positive integers.

  • record_zero_counts (bool, optional) – Whether zero-counts are actually recorded (stored) in the returned DataSet. If False, then zero counts are ignored, except for potentially registering new outcome labels. When reading from a cache file (using cache==True) this argument is ignored: the presence of zero- counts is dictated by the value of record_zero_counts when the cache file was created.

  • ignore_zero_count_lines (bool, optional) – Whether circuits for which there are no counts should be ignored (i.e. omitted from the DataSet) or not.

  • with_times (bool or "auto", optional) – Whether to the time-stamped data format should be read in. If “auto”, then the time-stamped format is allowed but not required on a per-circuit basis (so the dataset can contain both formats). Typically you only need to set this to False when reading in a template file.

  • circuit_parse_cache (dict, optional) – A dictionary mapping qubit string representations into created Circuit objects, which can improve performance by reducing or eliminating the need to parse circuit strings.

  • verbosity (int, optional) – If zero, no output is shown. If greater than zero, loading progress is shown.

Return type:

DataSet