qzhu2017 / PyXtal

A code to generate atomic structure with symmetry
MIT License
234 stars 59 forks source link

Low density crystal structure while using molecule with alkyl chains #164

Closed sli259 closed 2 years ago

sli259 commented 2 years ago

Hi, I find that if my monomer has long alkyl chains, the generated crystal structures always show a low density, no matter which space group I specified. Is there a way to avoid this and generate more compacted crystal? Here is an example I have, the density is always around 0.3.

struc = pyxtal(molecular=True)
    while True:
struc.from_random(3, 2, ['monomer.xyz'], [2], force_pass=True, conventional=False)
    if struc.valid:
        break

monomer.xyz: 48 Energy: 36.6552383 C -2.32648 1.96981 -0.07812 C -3.58418 1.36560 -0.13524 C -3.70638 -0.01650 0.01219 H -4.46752 1.97023 -0.29318 C -2.56772 -0.80969 0.21850 C -1.30655 -0.19471 0.28538 C -1.16992 1.19774 0.12842 H -4.69070 -0.46556 -0.03694 C -2.69756 -2.30637 0.37796 H -2.26002 3.04468 -0.19251 C 0.18204 1.88068 0.21653 H 0.64368 1.66093 1.20082 H 0.02798 2.98192 0.18691 C 1.16129 1.56974 -0.93920 H -0.44467 -0.81085 0.47823 C 1.64769 0.11557 -1.07023 H 2.05870 2.21156 -0.79845 H 0.68395 1.86904 -1.89785 C 2.38001 -0.38392 0.18669 H 2.34910 0.06498 -1.93180 H 0.79566 -0.54635 -1.32027 H -3.76389 -2.55586 0.41977 H -2.24470 -2.60780 1.34738 C -2.01351 -3.05089 -0.78508 H -2.44460 -2.74699 -1.76391 C -2.01033 -4.58939 -0.67248 H -0.94531 -2.74261 -0.77713 C -3.30510 -5.35421 -1.03015 H -1.63902 -4.89285 0.33021 H -1.26300 -4.94443 -1.41709 C -4.50113 -5.14784 -0.09252 H -3.03566 -6.43323 -0.99096 H -3.60704 -5.11836 -2.07428 H -4.18659 -5.31385 0.96053 C -5.63289 -6.11823 -0.42057 H -4.91782 -4.13444 -0.21477 H -5.29187 -7.16794 -0.29633 H -5.98259 -5.96742 -1.46417 H -6.48515 -5.94003 0.26918 H 3.26374 0.26280 0.38087 C 2.83046 -1.83865 0.01914 H 1.70897 -0.33150 1.06759 H 3.53200 -1.91897 -0.83929 H 1.94444 -2.48068 -0.18099 C 3.52214 -2.34668 1.28136 H 4.42334 -1.73611 1.50181 H 3.83173 -3.40310 1.13780 H 2.82750 -2.29659 2.14752

qzhu2017 commented 2 years ago

@sli259 PyXtal cannot predict the molecular volume well for your molecule. I suggest you do the following test:

from pyxtal import pyxtal
from time import time

for f in [1.1, 1.0, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4]:
    t0 = time()
    struc = pyxtal(molecular=True)
    while True:
        struc.from_random(3, 2, ['1.xyz'], factor=f, force_pass=True)
        if struc.valid:
            break
    #print(struc)
    print("Volume", struc.lattice.volume, "Time", time()-t0)
#struc.to_file('1.cif')
Volume 2382.614129289988 Time 0.4033069610595703
Volume 2166.0128448090795 Time 0.4060652256011963
Volume 1949.4115603281716 Time 0.37736988067626953
Volume 1732.8102758472637 Time 0.38421201705932617
Volume 1516.2089913663556 Time 0.4134688377380371
Volume 1299.6077068854477 Time 0.5457370281219482
Volume 1083.0064224045398 Time 0.4365048408508301
Volume 866.4051379236319 Time 0.501511812210083

The factor parameter allows you rescale the volume by hand. However, you need to keep in mind that it may take forever if the input volume is too small.