pygsti.objects.GateSet.bulk_dproduct

GateSet.bulk_dproduct(evalTree, flat=False, bReturnProds=False, bScale=False, comm=None)

Compute the derivative of a many gate strings at once.

Parameters:
  • evalTree (EvalTree) – given by a prior call to bulk_evaltree. Specifies the gate strings to compute the bulk operation on.
  • flat (bool, optional) – Affects the shape of the returned derivative array (see below).
  • bReturnProds (bool, optional) – when set to True, additionally return the probabilities.
  • bScale (bool, optional) – When True, return a scaling factor (see below).
  • comm (mpi4py.MPI.Comm, optional) – When not None, an MPI communicator for distributing the computation across multiple processors. Distribution is first done over the set of parameters being differentiated with respect to. If there are more processors than gateset parameters, distribution over a split evalTree (if given) is possible.
Returns:

  • derivs (numpy array) –

    • if flat == False, an array of shape S x M x G x G, where:

      • S == len(gatestring_list)
      • M == the length of the vectorized gateset
      • G == the linear dimension of a gate matrix (G x G gate matrices)

      and derivs[i,j,k,l] holds the derivative of the (k,l)-th entry of the i-th gate string product with respect to the j-th gateset parameter.

    • if flat == True, an array of shape S*N x M where:

      • N == the number of entries in a single flattened gate (ordering same as numpy.flatten),
      • S,M == as above,

      and deriv[i,j] holds the derivative of the (i % G^2)-th entry of the (i / G^2)-th flattened gate string product with respect to the j-th gateset parameter.

  • products (numpy array) – Only returned when bReturnProds == True. An array of shape S x G x G; products[i] is the i-th gate string product.

  • scaleVals (numpy array) – Only returned when bScale == True. An array of shape S such that scaleVals[i] contains the multiplicative scaling needed for the derivatives and/or products for the i-th gate string.