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

feature request: multiple modes animated simultaneously #27

Open
lucydot opened this issue Jun 1, 2017 · 12 comments
Open

feature request: multiple modes animated simultaneously #27

lucydot opened this issue Jun 1, 2017 · 12 comments

Comments

@lucydot
Copy link

lucydot commented Jun 1, 2017

It would be nice if multiple modes could be animated simultaneously, like this example. There is a primitive implementation (which reads from the phonopy mesh.yaml and vasp POSCAR) in Julia here.

@ajjackson
Copy link
Owner

You're not the first to ask about this!

In principle this is not difficult to implement; the modes are applied as a "difference" to the previous position at each frame, and can be superimposed easily enough.

The problem is that it's a bit of a departure in interface and experience. At the moment ascii-phonons is typically used to generate animated GIF files which loop over less than fifty frames. The time basis for the oscillation is related to the frame-rate. Please give some suggestions for

  • The preferred user interface for this feature
    • A new wrapper script with another name?
    • How to specify which modes to include?
  • Preferred output format
    • Drop into a Blender session?
    • Series of PNG files (good for computing small batches at a time, avoids losing work in case of crashes)
    • Youtube-ready movie formats?

How should off-gamma modes be treated? They are just as real as the gamma-point modes, it seems arbitrary to exclude them.

@jarvist
Copy link

jarvist commented Jun 1, 2017

'primitive implementation'?! 😱

@lucydot
Copy link
Author

lucydot commented Jun 1, 2017

Ha - i'm actually quoting your commit message there Jarv...

  • Preferred user interface: specify multiple modes at the command line -m mode1 mode2 mode3
  • Output format: generate the PNGs and use imagemagick to convert to GIF if option is passed
  • Off-gamma modes: I haven't thought about how the code has to differ for off-gamma, in my ignorance I don't understand why this would be more difficult. Or are you suggesting that the code would overlay modes at different wavevectors? Personally I don't think this would be necessary.

@ajjackson
Copy link
Owner

ajjackson commented Jun 1, 2017

It isn't more difficult from my end to overlay lots of different wavevectors, but it will require the user to run a lot more Phonopy and the output will become less and less orderly. The problematic part is answering the question: "why only include q-point Y?" if you are trying to understand something about the general movements of the system.

Overlaying just two or three modes could be quite useful if you have a particular intuition and want to study their composite effect. The only problem there is that the GIF won't loop nicely any more, otherwise it seems like a nice thing to have.

@jarvist
Copy link

jarvist commented Jun 1, 2017

More importantly, how are you going to improve on the Dalek-esque soundtrack?
https://www.youtube.com/watch?v=7UoPgFJcRoI

@lucydot
Copy link
Author

lucydot commented Jun 1, 2017

You make a good point. Ok, so say that user runs phonopy anime.conf multiple times for the q-points wanted. This will generate an ascii_file for each q-point called, say q1.ascii, q2.ascii, q3.ascii. Say that the user wants to superimpose eigenmodes 12 and 6 from the wavevector specified in q1.ascii and eigenmode 7 from wavevector specified in q3.ascii. The user could pass ascii-phonons -m q1.ascii 12 6 q3.ascii 7.

It's a clunky workflow, having to work with seperate files but I don't think phonopy has an output which contains all the necessary information in one place?

@jarvist
Copy link

jarvist commented Jun 1, 2017

Multiple q-points: I'm not sure if there's much point to combining them within one visual, as it all averages out (due to the random phases) once you start combining different phonon motion. So you'll very quickly get to a 'disordered mess' like a genuine MD simulation, rather than this which is presenting all of the relative harmonies of the dynamics. Looking at e.g. multiple Brillouin Zone boundary modes in a 2x2x2 supercell might be interesting.

With the Julia Phonons code you just need to add an exp(q-point) phase factor to the eigenvectors. Phonopy constructs + resolves the dynamic matrix for explicit q-points across the BZ, but this can be considered a perturbation in terms of the resulting eigenvectors. So you just need a 1-shot Phonopy calculation --> 'Gamma' set of eigenvectors, which you use everywhere.

I've never used the 'ascii' v-sim output of Phonopy, do you explicitly get the eigenvectors, or is it already pre-projected for you? As the eigenvectors themselves make up an orthogonal basis for small motion (the normal modes), you can just sum them together to get the 'conflation'.

BTW; not sure if this method has ever been used to visualise phonons (I've never seen it), though it is very similar to what is done to efficiently initialise molecular dynamics simulations with a per- normal-mode equilibrated thermal motion (constructed in normal modes), rather than randomly kicking each atom with a Maxwell-Boltzmann distribution (which can take AGES to then properly equilibriate).

@jarvist
Copy link

jarvist commented Jun 1, 2017

Sorry Lucy, our comments crossed in the aether.

I guess my perspective is that it's easier to directly use the eigenvectors/eigenvalues, and that these contain all the information that there possibly is, rather than starting with the ASCII v-sim output of Phonopy.

@ajjackson
Copy link
Owner

ajjackson commented Jun 1, 2017

v-sim .ascii files contain eigenvectors with mass weighting already applied, so yes it's easy to manipulate the rate and phase. That's also why ascii-phonons is able to use arbitrary supercells.

@ajjackson
Copy link
Owner

Aron asked me about audio representations of phonons before 😄 Seems like a good rainy weekend project!

@lucydot
Copy link
Author

lucydot commented Jun 1, 2017

Feature request! Listen to the phonons sing

@jarvist
Copy link

jarvist commented Jun 3, 2017

Did some more work on my codes, implementing arbitrary phase factors within the BZ, and visualising the MAPI conflation above, but now also with a BZ acoustic tilt mode.

https://www.youtube.com/watch?v=bzPqlh0ui8k&feature=youtu.be

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

No branches or pull requests

3 participants