pygsti.objects.GateSet.bulk_dpr

GateSet.bulk_dpr(spamLabel, evalTree, returnPr=False, clipTo=None, check=False, comm=None, wrtBlockSize=None)

Compute the derivatives of the probabilities generated by a each gate sequence given by evalTree, where initialization & measurement operations are always the same and are together specified by spamLabel.

Parameters:
  • spamLabel (string) – the label specifying the state prep and measure operations
  • evalTree (EvalTree) – given by a prior call to bulk_evaltree. Specifies the gate strings to compute the bulk operation on.
  • returnPr (bool, optional) – when set to True, additionally return the probabilities.
  • clipTo (2-tuple, optional) – (min,max) to clip returned probability to if not None. Only relevant when returnPr == True.
  • 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 differentiated with respect to (see wrtBlockSize).
  • wrtBlockSize (int, optional) – The maximum number of 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:

  • dprobs (numpy array) – An array of shape S x M, where

    • S == the number of gate strings
    • M == the length of the vectorized gateset

    and dprobs[i,j] holds the derivative of the i-th probability w.r.t. the j-th gateset parameter.

  • probs (numpy array) – Only returned when returnPr == True. An array of shape S containing the probabilities of each gate string.