pygsti.objects.GateSet.bulk_fill_hprobs

GateSet.bulk_fill_hprobs(mxToFill, spam_label_rows, evalTree=None, prMxToFill=None, derivMxToFill=None, clipTo=None, check=False, comm=None, wrtBlockSize=None)

Identical to bulk_hprobs(...) except results are placed into rows of a pre-allocated array instead of being returned in a dictionary.

Specifically, the probability hessians for all gate strings and a given SPAM label are placed into mxToFill[ spam_label_rows[spamLabel] ]. Optionally, probabilities and/or derivatives can be placed into prMxToFill[ spam_label_rows[spamLabel] ] and derivMxToFill[ spam_label_rows[spamLabel] ] respectively.

Parameters:
  • mxToFill (numpy array) – an already-allocated KxSxMxM numpy array, where K is larger than the maximum value in spam_label_rows, S is equal to the number of gate strings (i.e. evalTree.num_final_strings()), and M is the length of the vectorized gateset.
  • spam_label_rows (dictionary) – a dictionary with keys == spam labels and values which are integer row indices into mxToFill, specifying the correspondence between rows of mxToFill and spam labels.
  • evalTree (EvalTree) – given by a prior call to bulk_evaltree. Specifies the gate strings to compute the bulk operation on.
  • prMxToFill (numpy array, optional) – when not None, an already-allocated KxS numpy array that is filled with the probabilities as per spam_label_rows, similar to bulk_fill_probs(...).
  • derivMxToFill (numpy array, optional) – when not None, an already-allocated KxSxM numpy array that is filled with the probability derivatives as per spam_label_rows, similar to bulk_fill_dprobs(...).
  • clipTo (2-tuple) – (min,max) to clip returned probability to if not None. Only relevant when prMxToFill is not None.
  • check (boolean, optional) – If True, perform extra checks within code to verify correctness, generating warnings when checks fail. Used for testing, and runs much slower when True.
  • comm (mpi4py.MPI.Comm, optional) – When not None, an MPI communicator for distributing the computation across multiple processors. Distribution is first performed over subtrees of evalTree (if it is split), and then over blocks (subsets) of the parameters being second-differentiated with respect to (see wrtBlockSize).
  • wrtBlockSize (int, optional) – The maximum number of 2nd derivative columns to compute products for simultaneously. None means compute all columns at once. The minimum of wrtBlockSize and the size that makes maximal use of available processors is used as the final block size. Use this argument to reduce amount of intermediate memory required.
Returns:

Return type:

None