-
Notifications
You must be signed in to change notification settings - Fork 20
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
fix: typing issue for apply_hamiltonian #229
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #229 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 48 48
Lines 3745 3746 +1
Branches 910 910
=========================================
+ Hits 3745 3746 +1 ☔ View full report in Codecov by Sentry. |
src/braket/analog_hamiltonian_simulator/rydberg/numpy_solver.py
Outdated
Show resolved
Hide resolved
] | ||
|
||
dk_tilde = [ | ||
np.linalg.solve( | ||
np.eye(size_hilbert_space) + 1j * dt * _EIGVALS_A[i] * hamiltonian, | ||
np.sum([_INV_EIGVECS_A[i][j] * kx[j] for j in range(_STAGES)], axis=0), | ||
size_hilbert_space_eye_mat + 1j * dt * _EIGVALS_A[i] * hamiltonian, |
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.
Is it necessary to define size_hilbert_space_eye_mat
when it's only used once?
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 obj is being recreated for each iteration of _STAGES
when iterated through on L119 and then passed on to the solver (np.linalg.solve
) on L115
Issue #, if available:
Description of changes:
Testing done:
Merge Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.General
Tests
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.