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