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

Speed up wavefunction coefficient generation #18

Merged
merged 3 commits into from
Sep 23, 2024
Merged

Speed up wavefunction coefficient generation #18

merged 3 commits into from
Sep 23, 2024

Conversation

caleb-johnson
Copy link
Collaborator

@caleb-johnson caleb-johnson commented Sep 23, 2024

Create an index map for quick access during WF coeff generation. Reduces time complexity of the generation function from O(M*N) to O(NlogN), where M is the number of input determinants and N is the number of unique input determinants.

The old MlogN scaling came from the fact that we conducted a search (np.where) through all unique determinants (N) for each input determinant (M).

While the process of creating the coefficient array itself has been improved to O(M), the function is now bounded by the np.unique call, which performs an NlogN sorting routine.

qiskit_addon_dice_solver/dice_solver.py Outdated Show resolved Hide resolved
@caleb-johnson caleb-johnson merged commit fe265cf into main Sep 23, 2024
5 checks passed
@caleb-johnson caleb-johnson deleted the speedup branch September 23, 2024 16:37
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