Exemplo n.º 1
0
 def right_H_all(self):
     r"""
     Multiplies on the right by a Hadamard gate on each
     qubit. See :meth:`left_H` for more details.
     """
     u.array_swap(self.zc, self.xc)
     return self
Exemplo n.º 2
0
 def right_H_all(self):
     r"""
     Multiplies on the right by a Hadamard gate on each
     qubit. See :meth:`left_H` for more details.
     """
     u.array_swap(self.zc, self.xc)
     return self
Exemplo n.º 3
0
 def right_H(self,j):
     r"""
     Multiplies on the right by a Hadamard gate on the :math:`j^{\text{th}}`
     qubit. See :meth:`left_H` for more details.
     """
     u.array_swap(self.zc[:, j], self.xc[:, j])
     return self
Exemplo n.º 4
0
 def right_H(self,j):
     r"""
     Multiplies on the right by a Hadamard gate on the :math:`j^{\text{th}}`
     qubit. See :meth:`left_H` for more details.
     """
     u.array_swap(self.zc[:, j], self.xc[:, j])
     return self
Exemplo n.º 5
0
 def right_SWAP(self,j,k):
     r"""
     Multiplies on the right by a SWAP gate between the :math:`j^{\text{th}}`
     and :math:`k^{\text{th}}` qubits. See :meth:`left_SWAP` for more
     details.
     """
     u.array_swap(self.xc[:, j], self.xc[:, k])
     u.array_swap(self.zc[:, j], self.zc[:, k])
     return self
Exemplo n.º 6
0
 def right_SWAP(self,j,k):
     r"""
     Multiplies on the right by a SWAP gate between the :math:`j^{\text{th}}`
     and :math:`k^{\text{th}}` qubits. See :meth:`left_SWAP` for more
     details.
     """
     u.array_swap(self.xc[:, j], self.xc[:, k])
     u.array_swap(self.zc[:, j], self.zc[:, k])
     return self
Exemplo n.º 7
0
 def left_H(self,j):
     r"""
     Multiplies on the left by a Hadamard gate on the :math:`j^{\text{th}}`
     qubit. This method acts in-place, as opposed to acting on a copy of the
     binary symplectic matrix. In order to preserve the original matrix,
     use the :meth:`copy` method:
     
     >>> new_bsm = bsm.copy().left_H(idx) # doctest: +SKIP
     """
     u.array_swap(self.zr[j, :], self.xr[j, :])
     return self
Exemplo n.º 8
0
 def left_H(self,j):
     r"""
     Multiplies on the left by a Hadamard gate on the :math:`j^{\text{th}}`
     qubit. This method acts in-place, as opposed to acting on a copy of the
     binary symplectic matrix. In order to preserve the original matrix,
     use the :meth:`copy` method:
     
     >>> new_bsm = bsm.copy().left_H(idx) # doctest: +SKIP
     """
     u.array_swap(self.zr[j, :], self.xr[j, :])
     return self
Exemplo n.º 9
0
 def left_SWAP(self,j,k):
     r"""
     Multiplies on the left by a SWAP gate between the :math:`j^{\text{th}}`
     and :math:`k^{\text{th}}` qubits. This method acts in-place, as opposed
     to acting on a copy of the binary symplectic matrix. In order to
     preserve the original matrix, use the :meth:`copy` method:
     
     >>> new_bsm = bsm.copy().left_SWAP(j, k) # doctest: +SKIP
     """
     u.array_swap(self.xr[j, :], self.xr[k, :])
     u.array_swap(self.zr[j, :], self.zr[k, :])
     return self
Exemplo n.º 10
0
 def left_SWAP(self,j,k):
     r"""
     Multiplies on the left by a SWAP gate between the :math:`j^{\text{th}}`
     and :math:`k^{\text{th}}` qubits. This method acts in-place, as opposed
     to acting on a copy of the binary symplectic matrix. In order to
     preserve the original matrix, use the :meth:`copy` method:
     
     >>> new_bsm = bsm.copy().left_SWAP(j, k) # doctest: +SKIP
     """
     u.array_swap(self.xr[j, :], self.xr[k, :])
     u.array_swap(self.zr[j, :], self.zr[k, :])
     return self