pygsti.tools.matrixtools.zvals_int64_to_dense

pygsti.tools.matrixtools.zvals_int64_to_dense#

zvals_int64_to_dense(zvals_int, nqubits, outvec=None, trust_outvec_sparsity=False, abs_elval=None)#

Fills a dense array with the super-ket representation of a computational basis state.

Parameters:
  • zvals_int (int64) – The array of (up to 64) z-values, encoded as the 0s and 1s in the binary representation of this integer.

  • nqubits (int) – The number of z-values (up to 64)

  • outvec (numpy.ndarray, optional) – The output array, which must be a 1D array of length 4**nqubits or None, in which case a new array is allocated.

  • trust_outvec_sparsity (bool, optional) – When True, it is assumed that the provided outvec starts as all zeros and so only non-zero elements of outvec need to be set.

  • abs_elval (float) – the value 1 / (sqrt(2)**nqubits), which can be passed here so that it doesn’t need to be recomputed on every call to this function. If None, then we just compute the value.

Return type:

numpy.ndarray