-
Notifications
You must be signed in to change notification settings - Fork 15
add kinisi.Species and support multiple charged species in ConductivityAnalyzer
#179
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
base: main
Are you sure you want to change the base?
Conversation
| if ionic_charge is not None: | ||
| disp = disp * ionic_charge | ||
| s = sc.sum(disp**2, 'dimension') | ||
| total_dipole_disp = sc.sum(disp * ionic_charge, dim='particle') |
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.
I am not convinced this is the best approach. The _consolidate_system_particles should be available for both Conductivity and JumpDiffusion (it is useful if you run a really large simulation cell and want to split it up to improve statistics).
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.
I don't quite know how to implement this here. To efficiently consolidate, we would probably have to do this per species type but at this function call, we only have - at best - the charges available to distinguish. Any ideas?
kinisi/species.py
Outdated
| """ | ||
| indices: list[list[int]] | ||
| masses: list[float] | ||
| charge: float |
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 charge should be optional, with a value of 0 if nothing is given.
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.
I resolved this by changing the default
|
|
||
|
|
||
| @dataclasses.dataclass | ||
| class Species: |
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.
I need to think a bit about the naming of this.
|
This is an interesting proposal but a bit of a change from how things work currently. Need to think carefully about how this all works. |
|
I think this is a really nice idea. Indices will always need to be a 2d array. Thoughts? |
Thank you!
Adding For more complex features, I am mostly working with liquids and I am using SMILES / SMARTS to identify the indices (shameless advertisement https://zincware.github.io/rdkit2ase/) so one could, instead of |
I agree. I still think it would be useful to be able to specify the per atom charges though, in the same way as masses. |
|
Being able to define charges per atom would be nice. Of course, charge distributions will fluctuate over the course of an MD, but using e.g. the mean could give e.g. better estimates of the center of the dipole than just using the center of mass. I don't have the deep code knowledge of the package that you have and all these changes would require me to spend more time on this PR than I currently have. |
|
I am conscious that we need to be clear on how kinisi works for the centre of mass/charge style displacement things. I will try to address this in the jump diffusion documentation notebook now and open a PR. |
ConductivityAnalyzerwith multiple species #174specieorspecies_indicescan be usedThis draft introduces
kinisi.Speciesas an alternative of providing'specie_indices'as described belowand instead passing