exa-analytics / exatomic

A unified platform for theoretical and computational chemists
https://exa-analytics.github.io/exatomic
Apache License 2.0
19 stars 12 forks source link

Frequency visualization #184

Closed herbertludowieg closed 2 years ago

herbertludowieg commented 4 years ago

Added functionality to visualize the frequency normal mode displacement vectors on the universe widget.

Closes #181

Test code:

from exatomic.base import resource, list_resources
from exatomic.gaussian import Fchk
from exatomic.widgets import UniverseWidget as UW
ed = Fchk(resource('g16-methyloxirane-def2tzvp-freq.fchk')).to_universe()
UW(ed)

EDIT 06/12/2021:

To Do:

tjduigna commented 4 years ago

Hey I appreciate that this PR additionally addresses adding arrows to the UniverseWidget and I am not sure how you plan to implement animating the normal modes but I am wondering if you have ever stumbled on exatomic.core.atom.add_vibrational_mode which attempted a naive (and probably more inefficient) approach to frequency visualizations by computing all the nuclear displacements on the python side and then letting the default frame-based animation loop take responsibility for it all.

I don't think I ever added any consideration of scaling to get an appropriate time-scale as a function of x fps animation speed. Also, it merely constructs the frames to follow a sinusoidal trajectory along the displacement vectors (for a few loops) whereas maybe it's more appropriate for the frames to be constructed using a linear trajectory.

herbertludowieg commented 4 years ago

I did come across that function and for some time that was the way I have been doing it. Something I wanted to explore to animate the normal modes would be to generate them on the python side and have JS track the frames and do it in a similar way to the animation for the frames.

I would probably try to just calculate 20 frames. I noticed that was smooth enough.

avmarchenko commented 4 years ago

Hey @herbertludowieg what is the status of this PR? From the first comment, it looks like its still a WIP right? Please don't hesitate to request reviews when you think its ready.

avmarchenko commented 3 years ago

@herbertludowieg @tjduigna what are we thinking with respect to this PR?