Пример #1
0
 def test_conjugate_inplace(self):
     """test inplace conjugate"""
     ymat = numpy.array([[0, -1j], [1j, 0]])
     uni = Unitary([[0, 1j], [-1j, 0]])
     uni_conj = uni.conjugate(inplace=True)
     self.assertTrue(numpy.array_equal(uni._representation, ymat))
     self.assertTrue(uni._representation is uni_conj._representation)
Пример #2
0
 def test_conjugate(self):
     """test conjugate"""
     ymat = numpy.array([[0, -1j], [1j, 0]])
     uni = Unitary([[0, 1j], [-1j, 0]])
     self.assertTrue(
         numpy.array_equal(uni.conjugate()._representation, ymat))