pygsti.tools.symplectic.stabilizer_measurement_prob

pygsti.tools.symplectic.stabilizer_measurement_prob#

stabilizer_measurement_prob(state_sp_tuple, moutcomes, qubit_filter=None, return_state=False)#

Compute the probability of a given outcome when measuring some or all of the qubits in a stabilizer state.

Returns this probability, optionally along with the updated (post-measurement) stabilizer state.

Parameters:
  • state_sp_tuple (tuple) – A (s,p) tuple giving the stabilizer state to measure.

  • moutcomes (array-like) – The z-values identifying which measurement outcome (a computational basis state) to compute the probability for.

  • qubit_filter (iterable, optional) – If not None, a list of qubit indices which are measured. len(qubit_filter) should always equal len(moutcomes). If None, then assume all qubits are measured (len(moutcomes) == num_qubits).

  • return_state (bool, optional) – Whether the post-measurement (w/outcome moutcomes) state is also returned.

Returns:

  • p (float) – The probability of the given measurement outcome.

  • state_s,state_p (numpy.ndarray) – Only returned when return_state=True. The post-measurement stabilizer state representation (an updated version of state_sp_tuple).