pygsti.tools.symplectic.random_clifford

pygsti.tools.symplectic.random_clifford#

random_clifford(n, rand_state=None)#

Returns a Clifford, in the symplectic representation, sampled uniformly at random from the n-qubit Clifford group.

The core of this function uses the method of Robert Koenig and John A. Smolin, presented in “How to efficiently select an arbitrary Clifford group element”, for sampling a uniformly random symplectic matrix.

Parameters:
  • n (int) – The number of qubits the Clifford group is over.

  • rand_state (RandomState, optional) – A np.random.RandomState object for seeding RNG

Returns:

  • s (numpy array) – The symplectic matrix representing the uniformly sampled random Clifford.

  • p (numpy array) – The phase vector representing the uniformly sampled random Clifford.