pygsti.tools.symplectic.prep_stabilizer_state

pygsti.tools.symplectic.prep_stabilizer_state#

prep_stabilizer_state(nqubits, zvals=None)#

Construct the (s,p) stabilizer representation for a computational basis state given by zvals.

Parameters:
  • nqubits (int) – Number of qubits

  • zvals (iterable, optional) – An iterable over anything that can be cast as True/False to indicate the 0/1 value of each qubit in the Z basis. If None, the all-zeros state is created. If None, then all zeros is assumed.

Returns:

s,p – The stabilizer “matrix” and phase vector corresponding to the desired state. s has shape (2n,2n) (it includes antistabilizers) and p has shape 2n, where n equals nqubits.

Return type:

numpy.ndarray