Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto cell scaling function #291

Closed
qzhu2017 opened this issue Oct 25, 2024 · 3 comments
Closed

Auto cell scaling function #291

qzhu2017 opened this issue Oct 25, 2024 · 3 comments

Comments

@qzhu2017
Copy link
Collaborator

image

Find a direction with large spacing and then make the direction shorter.

@qzhu2017
Copy link
Collaborator Author

from pyxtal import pyxtal
from pyxtal.molecule import pyxtal_molecule

asp = pyxtal_molecule('CC(=O)OC1=CC=CC=C1C(=O)O.smi', active_sites=[(11), (12)])
xtal = pyxtal(molecular=True)
xtal.from_random(3, 14, [asp], sites=[["4e"]])
print(xtal)
print(xtal.get_separations([[1, 0, 0], [0, 1, 0], [0, 0, 1]]))
xtal.to_file('init.cif')

# Iteratively reduce the empty space
xtal.cut_lattice(2.0, True)
xtal.cut_lattice(2.0, True)
xtal.cut_lattice(2.0, True)
xtal.to_file('cut.cif')

site = xtal.mol_sites[0]
print(site.get_energy())
site.optimize_orientation_by_energy(20)#, verbose=True)
print(site.get_energy())
xtal.to_file('opt.cif')
print(xtal)

@qzhu2017
Copy link
Collaborator Author

qzhu2017 commented Nov 1, 2024

image

@qzhu2017
Copy link
Collaborator Author

qzhu2017 commented Nov 1, 2024

from pyxtal import pyxtal
from pyxtal.molecule import pyxtal_molecule

# Acceptor, Donor, H
asp = pyxtal_molecule('CC(=O)OC1=CC=CC=C1C(=O)O.smi', active_sites=[[11], [12], [20]])
xtal = pyxtal(molecular=True)

#xtal.from_random(3, 14, [asp], sites=[["4e"]])
xtal.from_random(3, 14, [asp], [8], sites=[["4e", "4e"]])
print(xtal); xtal.to_file('init.cif'); print(xtal.get_orientation_energy())
xtal.optimize_lattice_and_rotation()
print(xtal); xtal.to_file('opt.cif'); print(xtal.get_orientation_energy())

# BT: XXV
m1 = pyxtal_molecule('OC(=O)c1cc(cc(c1)N(=O)=O)N(=O)=O.smi', active_sites=[[], [0], [15]])
m2 = pyxtal_molecule('Cc1ccc2N3CN(Cc2c1)c1ccc(C)cc1C3.smi', active_sites=[[5], [], []])
xtal.from_random(3, 14, [m1, m2], [4, 4], sites=[["4e"], ["4e"]])
print(xtal); xtal.to_file('init.cif'); print(xtal.get_orientation_energy())
xtal.optimize_lattice_and_rotation()
print(xtal); xtal.to_file('opt.cif'); print(xtal.get_orientation_energy())

@qzhu2017 qzhu2017 closed this as completed Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant