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

Include option to save more (or all) basis state contributions to composition attribute of StarkMap object #106

Closed
dgenkina opened this issue Apr 1, 2022 · 3 comments · Fixed by #107

Comments

@dgenkina
Copy link
Contributor

dgenkina commented Apr 1, 2022

Currently, the diagonalize method of StarkMap objects calculates the eigenvalues and eigenvectors for all value of the electric field. But, while all the eigenvalues are saved in the 'y' attribute, for each perturbed eigenstate only the four top contributing eigenvector components (or the top components that comprise 0.95 of the total perturbed state composition) are saved in the 'composition' attribute.

I would like to include keyword arguments in the diagonalize method that would allow the user to choose how many basis states to save, or what total contribution to target, with the option of saving all the basis components. This was useful for me for calculating effective dipole matrix elements between arbitrary states, but I believe there could be several situations where people could find it useful.

I've forked the project and amended the code to include this capability. I can create a pull request if it is appropriate. Let me know if this is a bad idea for some reason or if more information is needed. Full disclosure, I've never tried to contribute back to a project before so I could be doing it wrong :)

@nikolasibalic
Copy link
Owner

Hello @dgenkina ,

That sounds amazing! Thank you for taking time to write a contribution! Please do submit a pull request. I will do a quick check then, and merge it to the main code to be released. Since you will be adding a new keyword argument, it would be great just if you can add in a docstring of a methods that were changed a short explanation how to use them (if you haven’t already added that). This way the change will be reflected in documentation too.

Let me know if you need any help with this.
And once again, thank you very much for taking time to contribute!

Nikola

@dgenkina
Copy link
Contributor Author

dgenkina commented Apr 1, 2022

Hi Nikola,

Thanks so much! I've submitted a pull request, let me know if it makes sense or if you have any questions/concerns. It's not a big change so hopefully not much room for error :)

Thanks,
Dina

@nikolasibalic
Copy link
Owner

Many thanks Dina @dgenkina for your contribution!

This is released on PyPI now in v3.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants