Allow measure_entanglement to calculate entanglement for multiple qubits#206
Allow measure_entanglement to calculate entanglement for multiple qubits#206madcpf wants to merge 4 commits intoquantumlib:mainfrom
Conversation
| from unitary.alpha.qudit_state_transform import qudit_to_qubit_unitary, num_bits | ||
| import numpy as np | ||
| import itertools | ||
| from itertools import combinations |
There was a problem hiding this comment.
Prefer import itertools then itertools.combinations below
"Use import statements for packages and modules only, not for individual types, classes, or functions."
https://google.github.io/styleguide/pyguide.html#22-imports
| entanglement[j][i] = entanglement[i][j] | ||
| names = list(self.object_name_dict.keys()) | ||
| data_frame = pd.DataFrame(entanglement, index=names, columns=names) | ||
| print(data_frame.round(1)) |
There was a problem hiding this comment.
Should we return the data_frame (or some other result) instead of printing it?
Printing it seems generally unhelpful if we are using this within a game.
| entropy = [0.0] * num_qubits | ||
| entropy_pair = np.zeros((num_qubits, num_qubits)) | ||
| entanglement = np.zeros((num_qubits, num_qubits)) | ||
| for i in range(num_qubits - 1): |
There was a problem hiding this comment.
I think this block is fairly tough to follow. I would add comments below or in the function's docstring to explain the implementation details.
|
@madcpf Thank you for this PR last year. It has been quite some time – could you let us know the status, and whether you are williing and interested in addressing the review comments above? |
Update quantum world to