pygsti.tools.errgenproptools.error_generator_commutator

pygsti.tools.errgenproptools.error_generator_commutator#

error_generator_commutator(errorgen_1, errorgen_2, flip_weight=False, weight=1.0, identity=None)#

Returns the commutator of two error generators. I.e. [errorgen_1, errorgen_2].

Parameters:
  • errorgen1 (LocalStimErrorgenLabel) – First error generator.

  • errorgen2 (LocalStimErrorgenLabel) – Second error generator

  • flip_weight (bool, optional (default False)) – If True flip the sign of the input value of weight kwarg.

  • weight (float, optional (default 1.0)) – An optional weighting value to apply to the value of the commutator.

  • identity (stim.PauliString, optional (default None)) – An optional stim.PauliString to use for comparisons to the identity. Passing in this kwarg isn’t necessary, but can allow for reduced stim.PauliString creation when calling this function many times for improved efficiency.

Returns:

  • list of `LocalStimErrorgenLabel`s corresponding to the commutator of the two input error generators,

  • weighted by the specified value of weight.