pygsti.layouts.matrixlayout

Defines the MatrixCOPALayout class.

Module Contents

Classes

MatrixCOPALayout

A circuit outcome probability array (COPA) layout for circuit simulation by process matrix multiplication.

class pygsti.layouts.matrixlayout.MatrixCOPALayout(circuits, model, dataset=None, num_sub_trees=None, num_tree_processors=1, num_param_dimension_processors=(), param_dimensions=(), param_dimension_blk_sizes=(), resource_alloc=None, verbosity=0)

Bases: pygsti.layouts.distlayout.DistributableCOPALayout

A circuit outcome probability array (COPA) layout for circuit simulation by process matrix multiplication.

A distributed layout that divides a list of circuits into several “evaluation trees” that compute subsets of the circuit outcomes by multiplying together process matrices. Often these evaluation trees correspond to available processors, but it can be useful to divide computations in order to lessen the amount of intermediate memory required.

MatrixCOPALayout instances create and store the decomposition of a list of circuits into a sequence of 2-term products of smaller strings. Ideally, this sequence would prescribe the way to obtain the entire list of circuits, starting with just the single gates, using the fewest number of multiplications, but this optimality is not guaranteed.

Parameters

circuitslist

A list of:class:Circuit objects representing the circuits this layout will include.

modelModel

The model that will be used to compute circuit outcome probabilities using this layout. This model is used to complete and expand the circuits in circuits.

datasetDataSet, optional

If not None, restrict the circuit outcomes stored by this layout to only the outcomes observed in this data set.

num_sub_treesint, optional

The number of groups (“sub-trees”) to divide the circuits into. This is the number of atoms for this layout.

num_tree_processorsint, optional

The number of atom-processors, i.e. groups of processors that process sub-trees.

num_param_dimension_processorstuple, optional

A 1- or 2-tuple of integers specifying how many parameter-block processors are used when dividing the physical processors into a grid. The first and second elements correspond to counts for the first and second parameter dimensions, respecively.

param_dimensionstuple, optional

The number of parameters along each parameter dimension. Can be an empty, 1-, or 2-tuple of integers which dictates how many parameter dimensions this layout supports.

param_dimension_blk_sizestuple, optional

The parameter block sizes along each present parameter dimension, so this should be the same shape as param_dimensions. A block size of None means that there should be no division into blocks, and that each block processor computes all of its parameter indices at once.

resource_allocResourceAllocation, optional

The resources available for computing circuit outcome probabilities.

verbosityint or VerbosityPrinter

Determines how much output to send to stdout. 0 means no output, higher integers mean more output.