Skip to content
Snippets Groups Projects
Commit 84423c33 authored by Antonio Manesco's avatar Antonio Manesco
Browse files

fix expectation value calculation

parent 424b2833
Branches
Tags
1 merge request!4Interface refactoring
Pipeline #178235 passed
......@@ -19,7 +19,7 @@ def expectation_value(density_matrix, observable):
"""
return np.sum(
[
np.trace(density_matrix[k] @ observable[k])
np.trace(observable[k] @ density_matrix[tuple(-np.array(k))])
for k in frozenset(density_matrix) & frozenset(observable)
]
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment