Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Cross <hodgestar+github@gmail.com>
  • Loading branch information
Ericgig and hodgestar committed May 13, 2024
1 parent 7edf083 commit e5d2877
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion qutip/core/qobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def to(self, data_type, copy=False):
Parameters
----------
data_type : type, str
The data-layer type or it's string alias that the data of this
The data-layer type or its string alias that the data of this
:class:`Qobj` should be converted to.
copy : Bool
Expand Down
1 change: 0 additions & 1 deletion qutip/entropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,5 @@ def entangling_power(U):
a = tensor(U, U).dag() * swap13 * tensor(U, U) * swap13
Uswap = swap() * U
b = tensor(Uswap, Uswap).dag() * swap13 * tensor(Uswap, Uswap) * swap13
print(a.tr(), b.tr())

return 5.0/9 - 1.0/36 * (a.tr() + b.tr()).real
2 changes: 0 additions & 2 deletions qutip/tests/test_entropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,4 @@ def test_triangle_inequality_4_qubits(self):
np.sin(np.pi*_alpha)**2 / 6, id="SWAP(alpha)"),
])
def test_entangling_power(gate, expected):
print("_alpha", _alpha)
print("gate", gate)
assert abs(qutip.entangling_power(gate) - expected) < 1e-12

0 comments on commit e5d2877

Please sign in to comment.