示例#1
0
    def _decompose_(self, qubits: Sequence[raw_types.QubitId]
                          ) -> op_tree.OP_TREE:
        q0, q1 = qubits
        right_gate0 = SingleQubitCliffordGate.from_single_map(
            z_to=(self.pauli0, self.invert0))
        right_gate1 = SingleQubitCliffordGate.from_single_map(
            z_to=(self.pauli1, self.invert1))

        left_gate0 = right_gate0**-1
        left_gate1 = right_gate1**-1
        yield left_gate0(q0)
        yield left_gate1(q1)
        yield common_gates.CZ(q0, q1)**self._exponent
        yield right_gate0(q0)
        yield right_gate1(q1)
示例#2
0
 def to_z_basis_ops(self) -> op_tree.OP_TREE:
     """Returns operations to convert the qubits to the computational basis.
     """
     for qubit, pauli in self.items():
         yield SingleQubitCliffordGate.from_single_map(
             {pauli: (Pauli.Z, False)})(qubit)