pygsti.objects.compose

pygsti.objects.compose(gate1, gate2, parameterization='auto')

Returns a new Gate that is the composition of gate1 and gate2.

The resulting gate’s matrix == dot(gate1, gate2),
(so gate1 acts second on an input) and the type of Gate instance returned will depend on how much of the parameterization in gate1 and gate2 can be preserved in the resulting gate.
Parameters:
  • gate1 (Gate) – Gate to compose as left term of matrix product (applied second).
  • gate2 (Gate) – Gate to compose as right term of matrix product (applied first).
  • parameterization ({“auto”,”full”,”TP”,”linear”,”static”}, optional) – The parameterization of the resulting gates. The default, “auto”, attempts to convert to the most restrictive common parameterization.
Returns:

The composed gate.

Return type:

Gate