Skip to content

Conversation

madcpf
Copy link
Collaborator

@madcpf madcpf commented Aug 1, 2024

Update quantum world to

  • allow measure_entanglement to calculate entanglement for multiple qubits;
  • add a new method to print pairwise entanglement results into a table.

@madcpf madcpf requested a review from dstrain115 August 1, 2024 23:05
from unitary.alpha.qudit_state_transform import qudit_to_qubit_unitary, num_bits
import numpy as np
import itertools
from itertools import combinations
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mhucka
Copy link
Contributor

mhucka commented Aug 28, 2025

@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?

@mhucka mhucka added the status/awaiting-response Waiting on a response to a question or request label Aug 28, 2025
@mhucka mhucka removed the status/awaiting-response Waiting on a response to a question or request label Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants