def circuit_decomposition(self): """ Decomposes the binary symplectic matrix """ # The circuit decomposition algorithm is long enough that it was moved # into another module, bsf_decomp. left, right = bsf_decomp.circuit_decomposition_part1(self.copy()) return left, right
def circuit_decomposition(self, validate=True): """ Decomposes the binary symplectic matrix using the algorithm of [AG04]_. .. todo:: Complete docstring. """ # The circuit decomposition algorithm is long enough that it was moved # into another module, bsf_decomp. left, right = bsf_decomp.circuit_decomposition_part1(self.copy()) circ = circuit.Circuit(*(right + list(reversed(left)))) if validate: assert all(circ.as_clifford().as_bsm()._arr == self._arr), "Decomposition failed to produce desired BSM." return circ
def circuit_decomposition(self, validate=True): """ Decomposes the binary symplectic matrix using the algorithm of [AG04]_. .. todo:: Complete docstring. """ # The circuit decomposition algorithm is long enough that it was moved # into another module, bsf_decomp. left, right = bsf_decomp.circuit_decomposition_part1(self.copy()) circ = circuit.Circuit(*(right + list(reversed(left)))) if validate: if all(self._arr == eye(self.nq * 2)): assert circ.as_clifford() is EmptyClifford, "Decomposition of an empty circuit did not produce an empty Clifford." else: assert all(circ.as_clifford().as_bsm()._arr == self._arr), "Decomposition failed to produce desired BSM." return circ