pygsti.layouts.prefixtable

Defines the PrefixTable class.

Module Contents

Classes

PrefixTable

An ordered list ("table") of circuits to evaluate, where common prefixes can be cached.

class pygsti.layouts.prefixtable.PrefixTable(circuits_to_evaluate, max_cache_size)

Bases: object

An ordered list (“table”) of circuits to evaluate, where common prefixes can be cached.

__len__(self)
find_splitting(self, max_sub_table_size=None, num_sub_tables=None, cost_metric='size', verbosity=0)

Find a partition of the indices of this table to define a set of sub-tables with the desire properties.

This is done in order to reduce the maximum size of any tree (useful for limiting memory consumption or for using multiple cores). Must specify either max_sub_tree_size or num_sub_trees.

Parameters
  • max_sub_table_size (int, optional) – The maximum size (i.e. list length) of each sub-table. If the original table is smaller than this size, no splitting will occur. If None, then there is no limit.

  • num_sub_tables (int, optional) – The maximum size (i.e. list length) of each sub-table. If the original table is smaller than this size, no splitting will occur.

  • verbosity (int, optional) – How much detail to send to stdout.

Returns

list – A list of sets of elements to place in sub-tables.