def test_EntropyLinear(): "Entropy: Linear entropy" # test_ entropy_vn = 0 for pure state psi = rand_ket(10) assert_equal(abs(entropy_linear(psi)) <= 1e-13, True) # test_ linear entropy always less than or equal to VN entropy rhos = [rand_dm(6) for k in range(10)] for k in rhos: assert_equal(entropy_linear(k) <= entropy_vn(k), True)
def test_EntropyLinear(): "Linear entropy" # test_ entropy_vn = 0 for pure state psi = rand_ket(10) assert_equal(abs(entropy_linear(psi)) <= 1e-13, True) # test_ linear entropy always less than or equal to VN entropy rhos = [rand_dm(6) for k in range(10)] for k in rhos: assert_equal(entropy_linear(k) <= entropy_vn(k), True)
def test_pure_state(self): assert abs(qutip.entropy_linear(qutip.rand_ket(10))) < 1e-12
def test_less_than_von_neumann(self): dm = qutip.rand_dm(10) assert qutip.entropy_linear(dm) <= qutip.entropy_vn(dm)