-
Notifications
You must be signed in to change notification settings - Fork 1
Sign mistakes etc in the exchange matrix elements (fixed in Gauss-Legendre backend only for now) #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -16,12 +16,14 @@ | |||||
|
|
||||||
|
|
||||||
| def _N_order(n1: int, m1: int, n2: int, m2: int) -> int: | ||||||
| return (n1 - m1) - (m2 - n2) | ||||||
| #return (n1 - m1) - (m2 - n2)# change here | ||||||
| return ((n1 - m1) + (m2 - n2)) | ||||||
|
Comment on lines
18
to
+20
|
||||||
|
|
||||||
|
|
||||||
| def _parity_factor(N: int) -> int: | ||||||
| """(-1)^((N+|N|)/2) → (-1)^N for N>=0, and 1 for N<0.""" | ||||||
|
||||||
| """(-1)^((N+|N|)/2) → (-1)^N for N>=0, and 1 for N<0.""" | |
| """(-1)^((N - |N|)/2): returns 1 for N >= 0, and (-1)^N for N < 0.""" |
Copilot
AI
Nov 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented-out code. The old implementation should be tracked in version control history, not left as comments in the codebase.
| #return (-1) ** ((N + abs(N)) // 2) # change here |
Copilot
AI
Nov 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented-out code. The old implementation should be tracked in version control history, not left as comments in the codebase.
Copilot
AI
Nov 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented-out code. The old implementation should be tracked in version control history, not left as comments in the codebase.
| #phase_factor = (1j) ** (d1 - d2) ## changed here |
Copilot
AI
Nov 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment "CHANGED HERE NEGATIVE B FIELD" on this line is misleading because this line was not actually changed in this PR (no "+" prefix in the diff). If the sign convention was already correct, remove the comment. If it needs to be changed to np.exp(1j * N * G_angles), make that change. Misleading comments can confuse future maintainers.
| phase = np.exp(-1j * N * G_angles) #CHANGED HERE NEGATIVE B FIELD | |
| phase = np.exp(-1j * N * G_angles) |
Copilot
AI
Nov 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented-out code. The old implementation should be tracked in version control history, not left as comments in the codebase.
| #phase = np.exp(1j * N * G_angles) |
Copilot
AI
Nov 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Remove trailing whitespace from the comment on this line.
| extra_sgn = (-1)**(n2-m2) # CHANGED HERE NEGATIVE B FIELD | |
| extra_sgn = (-1)**(n2-m2) # CHANGED HERE NEGATIVE B FIELD |
Copilot
AI
Nov 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This multi-line string is not assigned to any variable and appears after __all__, making it ineffective as module documentation. Consider either:
- Moving this content into the module docstring at the top of the file
- Creating a proper function/class to handle B-field direction as suggested
- Adding it as a comment in the relevant function's docstring
The current placement means it won't be accessible via help() or documentation tools.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -40,7 +40,10 @@ def _analytic_form_factor( | |||||
| laguerre_poly = eval_genlaguerre(n_min, delta_n_abs, arg_z) | ||||||
|
|
||||||
| # Phase convention: F_{n',n}(q) ∝ i^{|Δn|} e^{i (n - n') θ} | ||||||
| angles = (n_col - n_row) * q_angles + (np.pi / 2) * delta_n_abs | ||||||
| angles = (n_col - n_row) * q_angles + (np.pi / 2) * delta_n_abs #here | ||||||
|
||||||
| angles = (n_col - n_row) * q_angles + (np.pi / 2) * delta_n_abs #here | |
| angles = (n_col - n_row) * q_angles + (np.pi / 2) * delta_n_abs |
Copilot
AI
Nov 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unnecessary blank lines. These extra empty lines (lines 45-46) don't improve readability and should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented-out code. The old implementation should be tracked in version control history, not left as comments in the codebase.