[ase-users] MD simulation with NPT

Gaël Donval ggd21 at bath.ac.uk
Sun Dec 20 03:00:50 CET 2020


Dear Shi,

As stated in the error, your cell matrix is not upper-triangular (it is lower-triangular). An easy way to solve the problem would be swapping x and z (in atoms.positions) and swap your cell's first and last row.

Best,
Gaël


Dear ASE users,

I am trying to apply a NPT simulation on a molecular crystal cell. I used the npt.NPT function and here is part of the script:

atoms = read('mol.cif')
atoms.center()
atoms = atoms.repeat((N,N,N))
atoms.set_pbc(True)
…

###NPT equilibration ####
md = NPT(atoms, timestep= 2 * units.fs, temperature=300 * units.kB,
         ttime=25, pfactor=75, externalstress=6.3242e-7)

…

This gives me an error saying that:

    raise NotImplementedError("Can (so far) only operate on lists of atoms where the computational box is an upper triangular matrix.")
NotImplementedError: Can (so far) only operate on lists of atoms where the computational box is an upper triangular matrix.

Is this related with the cell I am applying? The cif file is from previous generations so the cell is not tetragonal:

Cell([[14.1543, 0.0, 0.0], [-7.073274963731859, 12.255717092338744, 0.0], [0.01606649983624844, -0.009667840015844734, 17.60119001205465]])

I am not sure if I did this correctly, is there a way to fix this issue? Also I am a little confuse about the externalstress for the NPT function, what should I use for 1bar?

Thank you for your help.

Shi



More information about the ase-users mailing list