Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
renatomello committed Oct 9, 2024
1 parent cb7bc00 commit ed2d9bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/qibo/quantum_info/entropies.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,8 +1017,8 @@ def relative_tsallis_entropy(
if len(target.shape) == 1:
target = backend.np.outer(target, backend.np.conj(target.T))

trace = matrix_power(state, alpha, backend)
trace = trace @ matrix_power(target, factor, backend)
trace = matrix_power(state, alpha, backend=backend)
trace = trace @ matrix_power(target, factor, backend=backend)
trace = backend.np.trace(trace)

return (1 - trace) / factor
Expand Down
4 changes: 2 additions & 2 deletions tests/test_quantum_info_entropies.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,8 +817,8 @@ def test_relative_tsallis_entropy(
if target_flag:
target = backend.np.outer(target, backend.np.conj(target.T))

target_value = matrix_power(state, alpha, backend)
target_value = target_value @ matrix_power(target, 1 - alpha, backend)
target_value = matrix_power(state, alpha, backend=backend)
target_value = target_value @ matrix_power(target, 1 - alpha, backend=backend)
target_value = (1 - backend.np.trace(target_value)) / (1 - alpha)

backend.assert_allclose(value, target_value)
Expand Down

0 comments on commit ed2d9bd

Please sign in to comment.