def test_power_inplace(self):
        """Test inplace power method."""
        # 10% depolarizing channel
        p_id = 0.9
        depol = SuperOp(self.depol_sop(1 - p_id))

        # Compose 3 times
        p_id3 = p_id ** 3
        depol.power(3, inplace=True)
        targ3 = SuperOp(self.depol_sop(1 - p_id3))
        self.assertEqual(depol, targ3)
    def test_power(self):
        """Test power method."""
        # 10% depolarizing channel
        p_id = 0.9
        depol = SuperOp(self.depol_sop(1 - p_id))

        # Compose 3 times
        p_id3 = p_id**3
        chan3 = depol.power(3)
        targ3 = SuperOp(self.depol_sop(1 - p_id3))
        self.assertEqual(chan3, targ3)