Пример #1
0
def octane():
    # CH3 CH2 CH2 CH2 CH2 CH2 CH2 CH3 #
    with Path("tests/molecules/octane.xyz") as path:
        structure = Atoms.from_ase_atoms(ase.io.read(path))
        structure.cell = 60 * np.identity(3)
        structure.translate((30., 30., 30.))
        yield structure
Пример #2
0
def hkust1_3x3x3_xyz():
    with Path("tests/hkust-1/hkust-1-3x3x3.xyz") as path:
        structure = Atoms.from_ase_atoms(ase.io.read(path))
        structure.cell = 79.0290 * np.identity(3)
        yield structure
Пример #3
0
def benzene():
    with Path("tests/molecules/benzene.xyz") as path:
        yield Atoms.from_ase_atoms(ase.io.read(path))
Пример #4
0
"""
Run and visualize with:

python -m cProfile -o hkustperf.pstats  -s tottime hkustperf.py
snakeviz hkustperf.pstats

"""

import ase
import ase.io

import numpy as np

from mofun import find_pattern_in_structure, replace_pattern_in_structure, Atoms

hkust1_cif = Atoms.load_cif("../tests/hkust-1/hkust-1-with-bonds.cif")
benzene = Atoms.from_ase_atoms(ase.io.read("../tests/molecules/benzene.xyz"))
hkust1_repped = hkust1_cif.replicate(repldims=(3, 3, 3))
match_indices = find_pattern_in_structure(hkust1_repped, benzene)