Code Monkey home page Code Monkey logo

animatemolecularvibrations's Introduction

Animate Molecular Vibrations

Generate normal modes using Psi4, and then visualize the vibrations in Blender

Requirements

  • Blender (developed using 4.0.1)
  • Python (developed using 3.11.6)
    • Psi4
    • Numpy
    • Pickle

How-to

The file "GenerateMolecularData.py" contains an initial guess for the coordinates of water, which you may replace with your desired molecule's coordinates.

This script will:

  • Optimize the geometry
  • Compute the frequencies
  • Create a dictionary with the geometry, the normal mode displacement matrices, and the associated frequencies
  • Use pickle to dump this dictionary into a file called "molecule_data.pkl"

You will then need to open Blender and copy and paste the script into Blender's Python Console. It is important to run it from within Blender and not through the terminal using blender --python, as this will define the functions Vibrate() and Render() within Blender's environment.

To animate the modes, type into the python console Vibrate().

The only required argument is: modes: A list with the normal mode indices that you would like to animate. The animation will consist of a some over all of the modes in the list, allowing for any complex motion to be constructed.

Optional arguments are: speed: A scalar multiplier that defines how fast the animation goes. amp: A list containing the amplitude of each mode that goes into the sum. phase: A list that allows you to control the relative phase between the modes, where np.pi/2 is 90-degrees out of phase.

animatemolecularvibrations's People

Contributors

maxparadiz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.