Git Product home page Git Product logo

Comments (1)

abelcarreras avatar abelcarreras commented on June 1, 2024

Check API example script:
https://github.com/abelcarreras/DynaPhoPy/blob/master/examples/api_scripts/script_silicon.py

The important point is that you have to create dynaphopy structure and trajectory objects from your ASE MD data.
For structure object you can check read_from_file_structure_poscar function:

def read_from_file_structure_poscar(file_name, number_of_dimensions=3):

For trajectory object you can check for instance read_VASP_XDATCAR function:

def read_VASP_XDATCAR(file_name, structure=None, time_step=None,

Basically:

import dynaphopy.atoms as atoms
structure = atoms.Structure(cell=latticevectors,  
                            scaled_positions=scaled_positions,
                            atomic_elements=atomic_types)

where latticevectors is a 3x3 numpy array with the unit cell lattice vectors in rows, scaled_positions is a Nax3 numpy array with the coordinates of the atoms in fractional coordinates, and atomic_types is a list with the atomic symbols of atoms

import dynaphopy.dynamics as dyn
trajectory =  dyn.Dynamics(structure=structure,
                           scaled_trajectory=trajectory_coordinates,
                           time=time,
                           supercell=super_cell)

where structure is the previously generated structure object, trajectory_coordinates is a NsxNax3 numpy array containing the coordinates of all the atoms at each time step in fractional coordinates, time is a Nsx1 list with the time corresponding at each step (in picoseconds) and super_cell is a 3x3 numpy array that defines the MD supercell respect to the unitcell (in general it is diagonal) :

MDCell = super_cell * UnitCell

from dynaphopy.

Related Issues (17)

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.