def test_povm_normalization_ic(dim):
for name, constructor in ALL_POVMS.items():
# Check that the POVM is normalized: elements must sum to the identity
current_povm = constructor(dim)
element_sum = sum(iter(current_povm))
assert_array_almost_equal(element_sum, np.eye(dim))
# Check that the attribute that says whether the POVM is IC is correct.
linear_inversion_recons = np.dot(current_povm.linear_inversion_map,
current_povm.probability_map)
if current_povm.informationally_complete:
assert_array_almost_equal(
linear_inversion_recons, np.eye(dim**2),
err_msg='POVM {} is not informationally complete'.format(name))
else:
assert np.abs(linear_inversion_recons - np.eye(dim**2)).max() > 0.1, \
'POVM {} is informationally complete'.format(name)
评论列表
文章目录