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

Adds Velocity, ShearStress, StressDiagonal, observables #285

Open
wants to merge 42 commits into
base: main
Choose a base branch
from

Conversation

harveydevereux
Copy link
Collaborator

@harveydevereux harveydevereux commented Aug 21, 2024

This adds a Velocity observable capable of averaging over supplied components x, y, z and atom lists. The behaviour is abstracted so also for stress we can obtain shear stress correlations $\langle \sigma_{xy}\sigma_{xy}\rangle+\langle \sigma_{yz}\sigma_{yz}\rangle+\langle \sigma_{zx}\sigma_{zx}\rangle$ with the built in ShearStress === Stress(['xy', 'yz', 'zx'])

  • ci tests now test against post-process vaf, dependent on changes to it post_process uses full correlation, fix filter_atoms #284 .

  • I used the ShearStress observable to get experimental viscosity for LiF which could be an example perhaps along with the VAF.

  • still need to fix the docs/ update the developer guide.

  • perhaps we could have a helper function to create Velocity-Velocity correlations from a structure (say, creating correlation_kwargs for different atom types automatically). As it stands Observable does not attach to a particular atoms object and so does not have this information at construction. Except implicitly via atoms: list[int].

  • Velocity can take a SliceLike or list[int]. So open-ended ranges can be specified i.e. slice(0, None), but also non-monotonic, decreasing or whatever sequences can be specified that cannot be represented as a slice.

bitmap

Copy link
Member

@ElliottKasoar ElliottKasoar left a comment

Choose a reason for hiding this comment

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

Looks like a good start, thanks @harveydevereux!

I suspect I knew a lot of the answers to my questions when we discussed this when you started, but maybe it's helpful coming to it with fresh eyes, so we can make things as clear as possible.

janus_core/helpers/correlator.py Outdated Show resolved Hide resolved
janus_core/helpers/correlator.py Outdated Show resolved Hide resolved
janus_core/helpers/janus_types.py Outdated Show resolved Hide resolved
janus_core/helpers/janus_types.py Outdated Show resolved Hide resolved
janus_core/helpers/correlator.py Outdated Show resolved Hide resolved
@ElliottKasoar ElliottKasoar added the enhancement New/improved feature or request label Oct 17, 2024
@ElliottKasoar ElliottKasoar linked an issue Oct 17, 2024 that may be closed by this pull request
janus_core/helpers/correlator.py Outdated Show resolved Hide resolved
janus_core/helpers/correlator.py Outdated Show resolved Hide resolved
janus_core/helpers/correlator.py Outdated Show resolved Hide resolved
janus_core/helpers/observables.py Outdated Show resolved Hide resolved
janus_core/helpers/observables.py Outdated Show resolved Hide resolved
janus_core/processing/observables.py Outdated Show resolved Hide resolved
janus_core/processing/observables.py Outdated Show resolved Hide resolved
janus_core/processing/observables.py Outdated Show resolved Hide resolved
janus_core/processing/observables.py Outdated Show resolved Hide resolved
janus_core/processing/observables.py Outdated Show resolved Hide resolved
janus_core/helpers/janus_types.py Outdated Show resolved Hide resolved
janus_core/helpers/utils.py Show resolved Hide resolved
docs/source/conf.py Outdated Show resolved Hide resolved
tests/test_utils.py Outdated Show resolved Hide resolved
janus_core/helpers/utils.py Show resolved Hide resolved
docs/source/developer_guide/tutorial.rst Outdated Show resolved Hide resolved
docs/source/developer_guide/tutorial.rst Outdated Show resolved Hide resolved
docs/source/developer_guide/tutorial.rst Outdated Show resolved Hide resolved
@ElliottKasoar
Copy link
Member

ElliottKasoar commented Nov 5, 2024

Not really work for this PR as such, but how easy would it be to integrate/use these in post processing, rather than on-the-fly calculations?

@harveydevereux
Copy link
Collaborator Author

Not really work for this PR as such, but how easy would it be to integrate/use these in post processing, rather than on-the-fly calculations?

All it needs is to be called on some sequence of atoms objects. But if you are post-processing why not just use post-process? The only advantage of these is they extract the data from Atoms in this case

@ElliottKasoar
Copy link
Member

All it needs is to be called on some sequence of atoms objects. But if you are post-processing why not just use post-process? The only advantage of these is they extract the data from Atoms in this case

Most significantly, I'm thinking about how easy it is to extend postprocess to observables we've defined, but aren't supported yet.

At the moment we can only do RDFs and VAFs, so if we didn't calculate any other observable on the fly, we might still want to be able to use an Observable.

It could also fit into unifying the interfaces e.g. for the VAF, depending on how their efficiencies compare, which would avoid questions about their consistency any time we make a change.

specify default case in docstring

Co-authored-by: ElliottKasoar <[email protected]>
janus_core/processing/observables.py Outdated Show resolved Hide resolved
janus_core/processing/observables.py Outdated Show resolved Hide resolved
@@ -278,6 +278,7 @@ janus\_core.processing.observables module
:private-members:
:undoc-members:
:show-inheritance:
:inherited-members:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This will show the inherited member self.components in the apidoc in e.g. Velocity and Stress and solve missing py:obj references.

CF https://stackoverflow.com/questions/5516032/docstring-inheritance-for-properties-using-sphinxs-autodoc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New/improved feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add velocity observables
4 participants