Ejemplo n.º 1
0
    def test_add_inplace(self):
        """Test inplace add method."""
        mat1 = 0.5 * self.sopI
        mat2 = 0.5 * self.depol_sop(1)
        targ = SuperOp(mat1 + mat2)

        chan1 = SuperOp(mat1)
        chan2 = SuperOp(mat2)
        chan1.add(chan2, inplace=True)
        self.assertEqual(chan1, targ)

        chan1 = SuperOp(mat1)
        chan2 = SuperOp(mat2)
        chan1 += chan2
        self.assertEqual(chan1, targ)
Ejemplo n.º 2
0
    def test_add(self):
        """Test add method."""
        mat1 = 0.5 * self.sopI
        mat2 = 0.5 * self.depol_sop(1)
        targ = SuperOp(mat1 + mat2)

        chan1 = SuperOp(mat1)
        chan2 = SuperOp(mat2)
        self.assertEqual(chan1.add(chan2), targ)
        self.assertEqual(chan1 + chan2, targ)