コード例 #1
0
ファイル: bsf.py プロジェクト: bcriger/python-quaec
 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
コード例 #2
0
ファイル: bsf.py プロジェクト: imranashraf/python-quaec
 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
コード例 #3
0
ファイル: bsf.py プロジェクト: tjochymoconnor/python-quaec
 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
コード例 #4
0
 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