Exemplo n.º 1
0
 def test_subsystem(self):
     p = qu.singlet_pairs(4)
     rhoab = p.ptr([2, 2, 2, 2], [0, 1])
     assert qu.negativity(rhoab, [2] * 2) > 0.5 - 1e-14
     rhoab = p.ptr([2, 2, 2, 2], [1, 2])
     assert qu.negativity(rhoab, [2] * 2) < 1e-14
     rhoab = p.ptr([2, 2, 2, 2], [2, 3])
     assert qu.negativity(rhoab, [2] * 2) > 0.5 - 1e-14
Exemplo n.º 2
0
 def test_subsystem(self):
     p = qu.singlet_pairs(4)
     rhoab = p.ptr([2, 2, 2, 2], [0, 1])
     assert qu.logneg(rhoab, [2] * 2) > 1 - 1e-14
     rhoab = p.ptr([2, 2, 2, 2], [1, 2])
     assert qu.logneg(rhoab, [2] * 2) < 1e-14
     rhoab = p.ptr([2, 2, 2, 2], [2, 3])
     assert qu.logneg(rhoab, [2] * 2) > 1 - 1e-14
Exemplo n.º 3
0
 def test_n2(self):
     p = singlet_pairs(2)
     assert_allclose(p, bell_state('psi-'))
     p = singlet_pairs(4)
     assert_allclose(p, bell_state('psi-') & bell_state('psi-'))