pygsti.tools.symplectic.random_phase_vector

pygsti.tools.symplectic.random_phase_vector#

random_phase_vector(s, n, rand_state=None)#

Generates a uniformly random phase vector for a n-qubit Clifford.

(This vector, together with the provided symplectic matrix, define a valid Clifford operation.) In combination with a uniformly random s the returned p defines a uniformly random Clifford gate.

Parameters:
  • s (numpy array) – The symplectic matrix to construct a random phase vector

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

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

Returns:

p – A phase vector sampled uniformly at random from all those phase vectors that, as a pair with s, define a valid n-qubit Clifford.

Return type:

numpy array