pygsti.tools.errgenproptools.slow_amplitude_of_state

pygsti.tools.errgenproptools.slow_amplitude_of_state#

slow_amplitude_of_state(tableau, desired_state, only_phase)#

Get the amplitude of a particular computational basis state for given stabilizer state.

Note: This is a pure python implementation of this function. For best performance see the optimized cython implementation tools.fasterrgencalc.fast_amplitude_of_state.

Parameters:
  • tableau (stim.Tableau or stim.TableauSimulator) – Stim tableau corresponding to the stabilizer state we wish to extract the amplitude from. If a stim.TableauSimulator it is assumed that this simulator has already had the appropriate inverse tableau value instantiated.

  • desired_state (str) – String of 0’s and 1’s corresponding to the computational basis state to extract the amplitude for.

  • only_phase (bool) – If True then on the phase of the complex amplitude is returned. In many cases this phase is the only information required, and for many qubits amplitude of any given state may underflow.

Returns:

amplitude – Amplitude of the desired computational basis state for a given stabilizer state.

Return type:

complex