Fixing atoms

76 views
Skip to first unread message

Nicolas Künzel

unread,
Sep 13, 2017, 6:44:06 AM9/13/17
to ipi-users
Hello,

I tried to set up a simulation with some atoms fixed at their positions and realised the following:

When reading xyz or pdb files the atom index starts with 1, but when defining which atoms to fix the index starts at zero. That is not big of a problem but it can lead to confusing.
Maybe you could change that? So that the index for the atom is always based at  1 or 0 but not both in different tags?

Kind regards

Nicolas

Michele Ceriotti

unread,
Sep 13, 2017, 8:13:32 AM9/13/17
to ipi-users
Not sure I understand the problem. The indices of arrays in Python are zero-based, and we stick to this convention. In xyz there is really no index, and in PDB well there's the PDB standard. Are there tags in i-PI that assume 1-based arrays? That would indeed be a bug!
Thanks for your feedback.

Nicolas Künzel

unread,
Sep 13, 2017, 8:32:41 AM9/13/17
to ipi-users
Oh alright.
I guess I just was confused since in the pdb input one starts at 1 so naturally I just used the indices as given to the program via this pdb file. But actually it does make more sense to use the zero based indices. But maybe just make that more clear in the documentation?
For example in the documentation of the <fixatoms> tag it doesn't say the indices start at zero although it should be clear anyway to the user already. Sometimes I am just a bit too fast when doing stuff.

Michele Ceriotti

unread,
Sep 13, 2017, 8:39:11 AM9/13/17
to ipi-users
I agree, the docs need improvement. Last time I checked fixatoms docstring was speaking of the input for a lattice cell!
Feel free to clarify the points that are unclear, and commit the changes as a pull request on github. It's only by having people
like you involved, who look into the details, that the documentation effort can move forward!
Thanks

Mariana Rossi

unread,
Sep 13, 2017, 10:22:18 AM9/13/17
to ipi-users
Hello, in the coming weeks I will be pushing a lot to the documentation. Please feel free to contribute, there is a lot to do.

Michele Ceriotti

unread,
Sep 13, 2017, 10:47:24 AM9/13/17
to ipi-users
Can you initiate a pull request on GH, so that Nicolas has a branch to commit to?

Mariana Rossi

unread,
Sep 13, 2017, 10:56:10 AM9/13/17
to ipi-users
Just created a branch in i-pi-dev called "doc-update".  As a starting stone, I changed v1.0 to v2.0 in the front page of the docs ;) 
Anything new please push to that branch!

Reply all
Reply to author
Forward
0 new messages