pygsti.tools.symplectic.compose_cliffords

pygsti.tools.symplectic.compose_cliffords#

compose_cliffords(s1, p1, s2, p2, do_checks=True)#

Multiplies two cliffords in the symplectic representation.

The output corresponds to the symplectic representation of C2 times C1 (i.e., C1 acts first) where s1 (s2) and p1 (p2) are the symplectic matrix and phase vector, respectively, for Clifford C1 (C2). This uses the formulas derived in Hostens and De Moor PRA 71, 042315 (2005).

Parameters:
  • s1 (numpy array) – The symplectic matrix over the integers mod 2 representing the first Clifford

  • p1 (numpy array) – The ‘phase vector’ over the integers mod 4 representing the first Clifford

  • s2 (numpy array) – The symplectic matrix over the integers mod 2 representing the second Clifford

  • p2 (numpy array) – The ‘phase vector’ over the integers mod 4 representing the second Clifford

  • do_checks (bool) – If True (default), check inputs and output are valid cliffords. If False, these checks are skipped (for speed)

Returns:

  • s (numpy array) – The symplectic matrix over the integers mod 2 representing the composite Clifford

  • p (numpy array) – The ‘phase vector’ over the integers mod 4 representing the composite Clifford