qzhu2017 / PyXtal

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

Some random generations take long time #224

Closed qzhu2017 closed 11 months ago

qzhu2017 commented 11 months ago
from pyxtal import pyxtal
from time import time
xtal = pyxtal()
for i in range(10):
    t0 = time()
    xtal.from_random(3, 208, ['C'], [36], sites=[['12j', '12j', '6f', '6e']], factor=1.5)
    print(xtal.valid, time()-t0)
qzhu2017 commented 11 months ago
from pyxtal import pyxtal
from time import time
pairs = [
(223, [36], [['12g', '12g', '6c', '6b']]),
(223, [36], [['12h', '12h', '6d', '6b']]),
(218, [38], [['12g', '12g', '6c', '6b', '2a']]),
(218, [38], [['12h', '12h', '6d', '6b', '2a']]),
(208, [42], [['12i', '12i', '6f', '6e', '6d']]),
(223, [42], [['12h', '12h', '6d', '6c', '6b']]),
(208, [46], [['12j', '12j', '6f', '6e', '6d', '4c']]),
(223, [44], [['12g', '12g', '8e', '6c', '6b']]),
(223, [36], [['12h', '12h', '12h']]),
(218, [36], [['12g', '12g', '12g']]),
(208, [36], [['12i', '12i', '12i']]),
(223, [36], [['12g', '12g', '12g']]),
(223, [38], [['12g', '12g', '12g', '2a']]),
(208, [40], [['12i', '12i', '12i', '4c']]),
(218, [42], [['12h', '12h', '12h', '6c']]),
(229, [86], [['24g', '24g', '24g', '8c', '6b']]),
]
for pair in pairs:
    (spg, numIons, sites) = pair
    for i in range(10):
        t0 = time()
        try:
            xtal = pyxtal()
            xtal.from_random(3, spg, ['C'], numIons, sites=sites, factor=1.5)
            print(i, sites, xtal.valid, xtal.lattice.volume, time()-t0)
            print(xtal)
        except:
            print("Error", i, sites, xtal.valid, time()-t0)