Skip to content
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

Update back_box_numeric.py #163

Merged
merged 1 commit into from
Nov 8, 2024
Merged

Conversation

gsteele13
Copy link
Contributor

see also issue 162:

#162

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

👏👏👏 You are awesome! Thank you for making your first pull request to pyEPR! This team work makes the pyEPR dream work! ' first pr

@@ -267,7 +267,7 @@ def PT_on_vector(original_vector, original_basis, pertub, energy0, evalue):

def closest_state_to(s):
def distance(s2):
return (s.dag() * s2[1]).norm()
return np.abs((s.dag() * s2[1]))
Copy link
Owner

Choose a reason for hiding this comment

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

Great!

Have you checked if this works with the new version?

And ideally if it is backwards compatible

There is also this possibility I think if not mistaken

return np.abs(np.vdot(s, s2[1]))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just tested it with a fresh install with python3.10 and latest numpy. Ran into no problems. Numpy was a red herring: it turns out that that was not the problem after all. I don't know exactly was, but the pull request fixes it.

Copy link
Owner

Choose a reason for hiding this comment

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

Thank you Garry! Going to merge

@zlatko-minev zlatko-minev merged commit b6907f3 into zlatko-minev:master Nov 8, 2024
2 of 3 checks passed
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.

2 participants