[ase-users] rotate atoms to minimize the surrounding cuboid volume

Michael Joseph Waters michael.j.waters at northwestern.edu
Tue Jan 28 04:12:37 CET 2020


Hi all,

I was curious about the related problem of finding the minimum volume cell or parallelepiped for an arbitrary set of points. I found a published algorithm: https://hal.inria.fr/inria-00071901/document. <https://hal.inria.fr/inria-00071901/document> ...but it looks tedious to implement.

Best,
-Mike
________________________________
From: ase-users-bounces at listserv.fysik.dtu.dk <ase-users-bounces at listserv.fysik.dtu.dk> on behalf of GENG SUN via ase-users <ase-users at listserv.fysik.dtu.dk>
Sent: Monday, January 27, 2020 6:20 PM
To: David Ollodart <davidollodart at gmail.com>
Cc: ase-users <ase-users at listserv.fysik.dtu.dk>
Subject: Re: [ase-users] rotate atoms to minimize the surrounding cuboid volume

Dear Ask and David,

Thanks so much for your reply.

I used the idea from David's answer, just to find two base vectors (a, b) to ensure that the diagonal aligns with the maximum distance vector between atoms.
This can reduce the total volume a little bit, but unfortunately, the computational cost does not decrease a lot.
So maybe I should find other ways to speed up my calculations.

Best Regards,

Geng


On Sat, Jan 25, 2020 at 4:15 PM David Ollodart <davidollodart at gmail.com<mailto:davidollodart at gmail.com>> wrote:
Dear Geng,

If you know the principal axis, and you want to rotate it to the diagonal, it is just a matter of defining the unit vector perpendicular to the two, and rotating the principle axis to align with the diagonal. I think the optimization problem, to find the orientation of a molecule in a box such that the box volume is minimum provided each atom must be at least a distance x away from each atom in other images, is not easy, even if you consider only a cube. If you guess that the principal axis with greatest moment of inertia should be perpendicular with the diagonal it just requires calculating the principal axes if you don't know them.

Best,

David

<snippet>
import numpy as np
p = np.array((1,0,0))
d = np.ones(3)/np.sqrt(3)
v = np.cross(p,d)
v *= np.arcsin(np.linalg.norm(v))/np.linalg.norm(v) #magnitude = angle in radians
from scipy.spatial.transform import Rotation
R = Rotation.from_rotvec(v)

from ase import Atoms
atoms = Atoms('H2', positions=((0,0,0),(0.54,0,0)))
cell = [(10,0,0),(0,10,0),(0,0,10)]
atoms.cell = cell
atoms.center()
COP = atoms.positions.mean(axis=0)
atoms.positions = R.apply(atoms.positions - COP) + COP

from ase.visualize import view
view(atoms)
</snippet>


On Sat, Jan 25, 2020 at 9:00 AM Ask Hjorth Larsen via ase-users <ase-users at listserv.fysik.dtu.dk<mailto:ase-users at listserv.fysik.dtu.dk>> wrote:
Dear Geng,

Am Sa., 25. Jan. 2020 um 16:41 Uhr schrieb GENG SUN via ase-users
<ase-users at listserv.fysik.dtu.dk<mailto:ase-users at listserv.fysik.dtu.dk>>:
>
> Dear ASE users,
>
> Is there a method in ase to rotate the atoms object to minimize the surrounding vacuum space?
> Since the molecule is elongated in one principal axis, I hope I can orient this axis with the diagonal of the box to minimize the total volume.
>
> Thank you very much in advance.

No, but it would be nice to have this if someone is willing to open a
merge request.

Best regards
Ask

>
> Best,
>
> Geng
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk<mailto:ase-users at listserv.fysik.dtu.dk>
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users<https://urldefense.proofpoint.com/v2/url?u=https-3A__listserv.fysik.dtu.dk_mailman_listinfo_ase-2Dusers&d=DwMFaQ&c=yHlS04HhBraes5BQ9ueu5zKhE7rtNXt_d012z2PA6ws&r=IWIXV02QNefgPQmc-Ovk6evJ6KEOZjyl5g4atrVIlcJ4WAvRgH8dNpuAIeIrVHn4&m=wfGhBYvYF5VpiO6DUPg5KbAV_QlEznK01G-28dsC8Lo&s=lflMMz7HwWpy7E_K955twkFP_gcHNUrrz8n-9XbjNlc&e=>
_______________________________________________
ase-users mailing list
ase-users at listserv.fysik.dtu.dk<mailto:ase-users at listserv.fysik.dtu.dk>
https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users<https://urldefense.proofpoint.com/v2/url?u=https-3A__listserv.fysik.dtu.dk_mailman_listinfo_ase-2Dusers&d=DwMFaQ&c=yHlS04HhBraes5BQ9ueu5zKhE7rtNXt_d012z2PA6ws&r=IWIXV02QNefgPQmc-Ovk6evJ6KEOZjyl5g4atrVIlcJ4WAvRgH8dNpuAIeIrVHn4&m=wfGhBYvYF5VpiO6DUPg5KbAV_QlEznK01G-28dsC8Lo&s=lflMMz7HwWpy7E_K955twkFP_gcHNUrrz8n-9XbjNlc&e=>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20200128/b48f36de/attachment.html>


More information about the ase-users mailing list