molSimplify 1.7.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- docs/source/conf.py +224 -0
- molSimplify/Classes/__init__.py +6 -0
- molSimplify/Classes/atom3D.py +235 -0
- molSimplify/Classes/dft_obs.py +130 -0
- molSimplify/Classes/globalvars.py +827 -0
- molSimplify/Classes/helpers.py +161 -0
- molSimplify/Classes/ligand.py +2330 -0
- molSimplify/Classes/mGUI.py +2493 -0
- molSimplify/Classes/mWidgets.py +438 -0
- molSimplify/Classes/miniGUI.py +41 -0
- molSimplify/Classes/mol2D.py +260 -0
- molSimplify/Classes/mol3D.py +5846 -0
- molSimplify/Classes/monomer3D.py +253 -0
- molSimplify/Classes/partialcharges.py +226 -0
- molSimplify/Classes/protein3D.py +1178 -0
- molSimplify/Classes/rundiag.py +151 -0
- molSimplify/Data/ML.dat +212 -0
- molSimplify/Data/MLS_FSR_for_inter.dat +23 -0
- molSimplify/Data/MLS_FSR_for_inter2.dat +23 -0
- molSimplify/Data/MLS_angle_for_click.dat +8 -0
- molSimplify/Data/MLS_angle_for_inter.dat +23 -0
- molSimplify/Data/MLS_angle_for_inter2.dat +48 -0
- molSimplify/Data/MLS_angle_for_intra.dat +10 -0
- molSimplify/Data/MLS_angle_for_intra2.dat +6 -0
- molSimplify/Data/MLS_angle_for_oa.dat +18 -0
- molSimplify/Data/ML_FSR_for_inter.dat +112 -0
- molSimplify/Data/ML_FSR_for_inter2.dat +110 -0
- molSimplify/Data/ML_bond_for_cat.dat +8 -0
- molSimplify/Data/ML_bond_for_click.dat +8 -0
- molSimplify/Data/ML_bond_for_inter.dat +48 -0
- molSimplify/Data/ML_bond_for_inter2.dat +48 -0
- molSimplify/Data/ML_bond_for_intra.dat +10 -0
- molSimplify/Data/ML_bond_for_intra2.dat +6 -0
- molSimplify/Data/ML_bond_for_oa.dat +18 -0
- molSimplify/Data/bp1.dat +21 -0
- molSimplify/Data/li.dat +3 -0
- molSimplify/Data/no.dat +2 -0
- molSimplify/Data/oct.dat +7 -0
- molSimplify/Data/pbp.dat +8 -0
- molSimplify/Data/spy.dat +6 -0
- molSimplify/Data/sqap.dat +9 -0
- molSimplify/Data/sqp.dat +5 -0
- molSimplify/Data/tbp.dat +6 -0
- molSimplify/Data/tdhd.dat +9 -0
- molSimplify/Data/thd.dat +5 -0
- molSimplify/Data/tpl.dat +4 -0
- molSimplify/Data/tpr.dat +7 -0
- molSimplify/Informatics/HFXsensitivity/__init__.py +0 -0
- molSimplify/Informatics/HFXsensitivity/measure_HFX_sensitivity_oxo_hat_reb_rel.py +443 -0
- molSimplify/Informatics/HFXsensitivity/measure_HFX_stable.py +346 -0
- molSimplify/Informatics/MOF/Linker_rotation.py +179 -0
- molSimplify/Informatics/MOF/MOF_descriptors.py +1299 -0
- molSimplify/Informatics/MOF/MOF_descriptors_alternate_functional.py +589 -0
- molSimplify/Informatics/MOF/MOF_functionalizer.py +1648 -0
- molSimplify/Informatics/MOF/PBC_functions.py +1347 -0
- molSimplify/Informatics/MOF/__init__.py +0 -0
- molSimplify/Informatics/MOF/atomic.py +267 -0
- molSimplify/Informatics/MOF/cluster_extraction.py +388 -0
- molSimplify/Informatics/MOF/fragment_MOFs_for_pormake.py +895 -0
- molSimplify/Informatics/MOF/monofunctionalized_BDC/index_information.py +10 -0
- molSimplify/Informatics/Mol2Parser.py +46 -0
- molSimplify/Informatics/RACassemble.py +408 -0
- molSimplify/Informatics/__init__.py +0 -0
- molSimplify/Informatics/active_learning/__init__.py +0 -0
- molSimplify/Informatics/active_learning/expected_improvement.py +269 -0
- molSimplify/Informatics/autocorrelation.py +1930 -0
- molSimplify/Informatics/clean_autocorrelation.py +778 -0
- molSimplify/Informatics/coulomb_analyze.py +67 -0
- molSimplify/Informatics/decoration_manager.py +193 -0
- molSimplify/Informatics/geo_analyze.py +88 -0
- molSimplify/Informatics/geometrics.py +56 -0
- molSimplify/Informatics/graph_analyze.py +163 -0
- molSimplify/Informatics/graph_racs.py +288 -0
- molSimplify/Informatics/jupyter_vis.py +172 -0
- molSimplify/Informatics/lacRACAssemble.py +2192 -0
- molSimplify/Informatics/lacRACAssemble_bisdithiolenes.py +236 -0
- molSimplify/Informatics/misc_descriptors.py +198 -0
- molSimplify/Informatics/organic_fingerprints.py +61 -0
- molSimplify/Informatics/partialcharges.py +345 -0
- molSimplify/Informatics/protein/activesite.py +53 -0
- molSimplify/Informatics/protein/pymol_add_hs.py +33 -0
- molSimplify/Informatics/rac155_geo.py +48 -0
- molSimplify/Ligands/(1_methylbenzimidazol_2_yl)pyridine.xyz +45 -0
- molSimplify/Ligands/1-4-dimethyl-1-2-3-triazole.xyz +15 -0
- molSimplify/Ligands/12crown4.mol +62 -0
- molSimplify/Ligands/Antipyrine.mol +58 -0
- molSimplify/Ligands/BPAbipy.mol +106 -0
- molSimplify/Ligands/Hpyrrole.mol +26 -0
- molSimplify/Ligands/N-quinolinylbutyramidate.xyz +31 -0
- molSimplify/Ligands/N-quinolinylmethylmethinylacetamidate.xyz +30 -0
- molSimplify/Ligands/NMe2_-1.xyz +11 -0
- molSimplify/Ligands/PCy3.mol +111 -0
- molSimplify/Ligands/PMe3.xyz +15 -0
- molSimplify/Ligands/PPh3.mol +76 -0
- molSimplify/Ligands/Propyphenazone.mol +77 -0
- molSimplify/Ligands/acac.mol +33 -0
- molSimplify/Ligands/acacen.mol +76 -0
- molSimplify/Ligands/acetate.smi +1 -0
- molSimplify/Ligands/acetate.xyz +9 -0
- molSimplify/Ligands/aceticacidbipyridine.mol +70 -0
- molSimplify/Ligands/acetonitrile.mol +17 -0
- molSimplify/Ligands/alanine.mol +30 -0
- molSimplify/Ligands/alphabetizer.py +21 -0
- molSimplify/Ligands/amine.mol +11 -0
- molSimplify/Ligands/ammonia.mol +12 -0
- molSimplify/Ligands/arginine.mol +58 -0
- molSimplify/Ligands/asparagine.mol +38 -0
- molSimplify/Ligands/aspartic_acid.mol +35 -0
- molSimplify/Ligands/azide.mol +11 -0
- molSimplify/Ligands/benzene.mol +28 -0
- molSimplify/Ligands/benzene_pi.mol +30 -0
- molSimplify/Ligands/benzenedithiol.mol +30 -0
- molSimplify/Ligands/benzenethiol.mol +30 -0
- molSimplify/Ligands/benzylisocy.mol +38 -0
- molSimplify/Ligands/bidiazine.mol +42 -0
- molSimplify/Ligands/bidiazole.mol +38 -0
- molSimplify/Ligands/bifuran.mol +38 -0
- molSimplify/Ligands/bihydrodiazine.mol +58 -0
- molSimplify/Ligands/bihydrodiazole.mol +46 -0
- molSimplify/Ligands/bihydrooxazine.mol +54 -0
- molSimplify/Ligands/bihydrooxazole.mol +42 -0
- molSimplify/Ligands/bihydrothiazine.mol +54 -0
- molSimplify/Ligands/bihydrothiazole.mol +42 -0
- molSimplify/Ligands/biimidazole.mol +38 -0
- molSimplify/Ligands/bioxazole.mol +34 -0
- molSimplify/Ligands/bipy.mol +46 -0
- molSimplify/Ligands/bipyrazine.xyz +20 -0
- molSimplify/Ligands/bipyrimidine.mol +42 -0
- molSimplify/Ligands/bipyrrole.mol +42 -0
- molSimplify/Ligands/bisnapthyridylpyridine.mol +111 -0
- molSimplify/Ligands/bithiazole.mol +34 -0
- molSimplify/Ligands/bromide.mol +7 -0
- molSimplify/Ligands/bromide.smi +1 -0
- molSimplify/Ligands/c2.mol +9 -0
- molSimplify/Ligands/caprolactone.mol +41 -0
- molSimplify/Ligands/carbonyl.mol +8 -0
- molSimplify/Ligands/carboxyl.mol +13 -0
- molSimplify/Ligands/cat.mol +30 -0
- molSimplify/Ligands/chloride.mol +7 -0
- molSimplify/Ligands/chloride.smi +1 -0
- molSimplify/Ligands/chloropyridine.mol +27 -0
- molSimplify/Ligands/co2.mol +10 -0
- molSimplify/Ligands/corrolazine.mol +72 -0
- molSimplify/Ligands/cs.mol +8 -0
- molSimplify/Ligands/cyanate.xyz +5 -0
- molSimplify/Ligands/cyanide.mol +9 -0
- molSimplify/Ligands/cyanoaceticporphyrin.mol +114 -0
- molSimplify/Ligands/cyanopyridine.mol +29 -0
- molSimplify/Ligands/cyclam.mol +81 -0
- molSimplify/Ligands/cyclen.mol +69 -0
- molSimplify/Ligands/cyclopentadienyl.mol +26 -0
- molSimplify/Ligands/cysteine.mol +32 -0
- molSimplify/Ligands/diaminomethyl.mol +19 -0
- molSimplify/Ligands/diazine.mol +25 -0
- molSimplify/Ligands/diazole.mol +23 -0
- molSimplify/Ligands/dicyanamide.mol +15 -0
- molSimplify/Ligands/dihydrofuran.mol +27 -0
- molSimplify/Ligands/dmap.xyz +35 -0
- molSimplify/Ligands/dmf.mol +28 -0
- molSimplify/Ligands/dmi.mol +41 -0
- molSimplify/Ligands/dmpe.mol +52 -0
- molSimplify/Ligands/dpmu.mol +47 -0
- molSimplify/Ligands/dppe.mol +112 -0
- molSimplify/Ligands/edta.mol +69 -0
- molSimplify/Ligands/en.mol +28 -0
- molSimplify/Ligands/ethanethiol.mol +21 -0
- molSimplify/Ligands/ethanolamine.mol +26 -0
- molSimplify/Ligands/ethbipy.mol +70 -0
- molSimplify/Ligands/ethyl.mol +19 -0
- molSimplify/Ligands/ethylamine.mol +24 -0
- molSimplify/Ligands/ethylene.mol +16 -0
- molSimplify/Ligands/ethylesteracac.mol +57 -0
- molSimplify/Ligands/fluoride.mol +7 -0
- molSimplify/Ligands/fluoride.smi +1 -0
- molSimplify/Ligands/formaldehyde.mol +12 -0
- molSimplify/Ligands/formamidate.xyz +8 -0
- molSimplify/Ligands/formate.xyz +6 -0
- molSimplify/Ligands/furan.mol +23 -0
- molSimplify/Ligands/glutamic_acid.mol +42 -0
- molSimplify/Ligands/glutamine.mol +44 -0
- molSimplify/Ligands/glycinate.mol +23 -0
- molSimplify/Ligands/glycine.mol +24 -0
- molSimplify/Ligands/h2s.mol +10 -0
- molSimplify/Ligands/helium.mol +6 -0
- molSimplify/Ligands/histidine.mol +45 -0
- molSimplify/Ligands/hmpa.mol +62 -0
- molSimplify/Ligands/hs-.mol +9 -0
- molSimplify/Ligands/hydride.mol +7 -0
- molSimplify/Ligands/hydrocarboxyacetylide.xyz +8 -0
- molSimplify/Ligands/hydrocyanide.mol +10 -0
- molSimplify/Ligands/hydrodiazine.mol +33 -0
- molSimplify/Ligands/hydrodiazole.mol +27 -0
- molSimplify/Ligands/hydrogensulfide.mol +10 -0
- molSimplify/Ligands/hydroisocyanide.mol +11 -0
- molSimplify/Ligands/hydrooxazine.mol +31 -0
- molSimplify/Ligands/hydrooxazole.mol +25 -0
- molSimplify/Ligands/hydrothiazine.mol +31 -0
- molSimplify/Ligands/hydrothiazole.mol +25 -0
- molSimplify/Ligands/hydroxyl.mol +9 -0
- molSimplify/Ligands/imidazole.mol +23 -0
- molSimplify/Ligands/imidazolidinone.mol +29 -0
- molSimplify/Ligands/imine.mol +13 -0
- molSimplify/Ligands/iminodiacetic.mol +33 -0
- molSimplify/Ligands/iodide.mol +7 -0
- molSimplify/Ligands/iodobenzene.xyz +14 -0
- molSimplify/Ligands/isoleucine.mol +48 -0
- molSimplify/Ligands/isothiocyanate.mol +11 -0
- molSimplify/Ligands/leucine.mol +48 -0
- molSimplify/Ligands/ligands.dict +257 -0
- molSimplify/Ligands/lysine.mol +54 -0
- molSimplify/Ligands/mebenzenedithiol.mol +36 -0
- molSimplify/Ligands/mebim_py.xyz +29 -0
- molSimplify/Ligands/mebim_pz.xyz +28 -0
- molSimplify/Ligands/mebipy.mol +58 -0
- molSimplify/Ligands/mecat.mol +36 -0
- molSimplify/Ligands/methanal.mol +11 -0
- molSimplify/Ligands/methanethiol.mol +15 -0
- molSimplify/Ligands/methanol.mol +16 -0
- molSimplify/Ligands/methionine.mol +44 -0
- molSimplify/Ligands/methyl.mol +13 -0
- molSimplify/Ligands/methylacetylide.xyz +8 -0
- molSimplify/Ligands/methylamine.mol +19 -0
- molSimplify/Ligands/methylazide.xyz +9 -0
- molSimplify/Ligands/methylisocy.mol +17 -0
- molSimplify/Ligands/methylpyridine.mol +33 -0
- molSimplify/Ligands/n2.mol +8 -0
- molSimplify/Ligands/n4py.xyz +51 -0
- molSimplify/Ligands/nch.mol +10 -0
- molSimplify/Ligands/nco-.mol +11 -0
- molSimplify/Ligands/nethanolamine.mol +26 -0
- molSimplify/Ligands/nitrate.mol +14 -0
- molSimplify/Ligands/nitrite.mol +11 -0
- molSimplify/Ligands/nitro.mol +11 -0
- molSimplify/Ligands/nitrobipy.mol +54 -0
- molSimplify/Ligands/nitroso.mol +8 -0
- molSimplify/Ligands/nme3.mol +30 -0
- molSimplify/Ligands/no-.mol +10 -0
- molSimplify/Ligands/no2-.mol +11 -0
- molSimplify/Ligands/noxygen.mol +8 -0
- molSimplify/Ligands/ns-.mol +10 -0
- molSimplify/Ligands/o-pyridylbenzene.xyz +23 -0
- molSimplify/Ligands/o-pyridylphenylanion.xyz +22 -0
- molSimplify/Ligands/o2-.mol +9 -0
- molSimplify/Ligands/o2.xyz +4 -0
- molSimplify/Ligands/och2.mol +12 -0
- molSimplify/Ligands/oethanolamine.mol +26 -0
- molSimplify/Ligands/ome2.mol +22 -0
- molSimplify/Ligands/ooh.xyz +5 -0
- molSimplify/Ligands/oxalate.mol +17 -0
- molSimplify/Ligands/oxalate.smi +1 -0
- molSimplify/Ligands/oxygen.mol +7 -0
- molSimplify/Ligands/pentacyanocyclopentadienide.mol +36 -0
- molSimplify/Ligands/ph2-.mol +11 -0
- molSimplify/Ligands/ph3.mol +12 -0
- molSimplify/Ligands/phen.mol +51 -0
- molSimplify/Ligands/phenacac.mol +63 -0
- molSimplify/Ligands/phenalalanine.mol +51 -0
- molSimplify/Ligands/phendione.mol +51 -0
- molSimplify/Ligands/phenphen.mol +75 -0
- molSimplify/Ligands/phenylbenzoxazole.mol +54 -0
- molSimplify/Ligands/phenylcyc.mol +99 -0
- molSimplify/Ligands/phenylenediamine.mol +37 -0
- molSimplify/Ligands/phenylisocy.mol +32 -0
- molSimplify/Ligands/phosacidbipy.mol +66 -0
- molSimplify/Ligands/phosphine.mol +13 -0
- molSimplify/Ligands/phosphorine.mol +27 -0
- molSimplify/Ligands/phosphorustrifluoride.mol +12 -0
- molSimplify/Ligands/phthalocyanine.mol +126 -0
- molSimplify/Ligands/pme3o.mol +32 -0
- molSimplify/Ligands/porphyrin.mol +82 -0
- molSimplify/Ligands/pph3o.mol +77 -0
- molSimplify/Ligands/proline.mol +39 -0
- molSimplify/Ligands/propdiol.mol +21 -0
- molSimplify/Ligands/propylene.mol +23 -0
- molSimplify/Ligands/pyridine.mol +27 -0
- molSimplify/Ligands/pyrimidone.mol +27 -0
- molSimplify/Ligands/pyrrole.mol +24 -0
- molSimplify/Ligands/quinoxalinedithiol.mol +39 -0
- molSimplify/Ligands/s2-.mol +9 -0
- molSimplify/Ligands/salen.mol +75 -0
- molSimplify/Ligands/salphen.mol +84 -0
- molSimplify/Ligands/serine.mol +32 -0
- molSimplify/Ligands/simple_ligands.dict +14 -0
- molSimplify/Ligands/sulfacidbipy.mol +63 -0
- molSimplify/Ligands/tbucat.mol +54 -0
- molSimplify/Ligands/tbuphisocy.mol +56 -0
- molSimplify/Ligands/tbutylcyclen.mol +166 -0
- molSimplify/Ligands/tbutylisocy.mol +35 -0
- molSimplify/Ligands/tbutylthiol.mol +33 -0
- molSimplify/Ligands/tcnoet.mol +43 -0
- molSimplify/Ligands/tcnoetOH.mol +45 -0
- molSimplify/Ligands/terpy.mol +65 -0
- molSimplify/Ligands/tetrahydrofuran.mol +31 -0
- molSimplify/Ligands/thiane.mol +37 -0
- molSimplify/Ligands/thiazole.mol +21 -0
- molSimplify/Ligands/thiocyanate.mol +11 -0
- molSimplify/Ligands/thiol.mol +9 -0
- molSimplify/Ligands/thiophene.mol +23 -0
- molSimplify/Ligands/thiopyridine.mol +29 -0
- molSimplify/Ligands/threonine.mol +38 -0
- molSimplify/Ligands/tpp.mol +165 -0
- molSimplify/Ligands/tricyanomethyl.mol +19 -0
- molSimplify/Ligands/trifluoromethyl.mol +13 -0
- molSimplify/Ligands/tryptophan.mol +60 -0
- molSimplify/Ligands/tyrosine.mol +53 -0
- molSimplify/Ligands/uthiol.mol +11 -0
- molSimplify/Ligands/uthiolme2.mol +23 -0
- molSimplify/Ligands/valine.mol +42 -0
- molSimplify/Ligands/water.mol +10 -0
- molSimplify/Ligands/x.mol +6 -0
- molSimplify/Scripts/__init__.py +0 -0
- molSimplify/Scripts/addtodb.py +308 -0
- molSimplify/Scripts/cellbuilder.py +1592 -0
- molSimplify/Scripts/cellbuilder_tools.py +701 -0
- molSimplify/Scripts/chains.py +342 -0
- molSimplify/Scripts/convert_2to3.py +23 -0
- molSimplify/Scripts/dbinteract.py +631 -0
- molSimplify/Scripts/distgeom.py +617 -0
- molSimplify/Scripts/findcorrelations.py +287 -0
- molSimplify/Scripts/generator.py +267 -0
- molSimplify/Scripts/geometry.py +1224 -0
- molSimplify/Scripts/grabguivars.py +845 -0
- molSimplify/Scripts/in_b3lyp_usetc.py +141 -0
- molSimplify/Scripts/inparse.py +1673 -0
- molSimplify/Scripts/io.py +1149 -0
- molSimplify/Scripts/isomers.py +415 -0
- molSimplify/Scripts/jobgen.py +247 -0
- molSimplify/Scripts/krr_prep.py +1262 -0
- molSimplify/Scripts/molSimplify_io.py +18 -0
- molSimplify/Scripts/molden2psi4wfn.py +166 -0
- molSimplify/Scripts/namegen.py +32 -0
- molSimplify/Scripts/nn_prep.py +561 -0
- molSimplify/Scripts/oct_check_mols.py +782 -0
- molSimplify/Scripts/periodic_QE.py +97 -0
- molSimplify/Scripts/postmold.py +304 -0
- molSimplify/Scripts/postmwfn.py +709 -0
- molSimplify/Scripts/postparse.py +488 -0
- molSimplify/Scripts/postproc.py +139 -0
- molSimplify/Scripts/qcgen.py +1450 -0
- molSimplify/Scripts/rmsd.py +489 -0
- molSimplify/Scripts/rungen.py +670 -0
- molSimplify/Scripts/structgen.py +3040 -0
- molSimplify/Scripts/tf_nn_prep.py +894 -0
- molSimplify/Scripts/tsgen.py +295 -0
- molSimplify/Scripts/uq_calibration.py +69 -0
- molSimplify/__init__.py +0 -0
- molSimplify/__main__.py +197 -0
- molSimplify/icons/chemdb.png +0 -0
- molSimplify/icons/hjklogo.png +0 -0
- molSimplify/icons/icon.png +0 -0
- molSimplify/icons/logo.png +0 -0
- molSimplify/icons/logo_old.png +0 -0
- molSimplify/icons/petachem.png +0 -0
- molSimplify/icons/petachem2.png +0 -0
- molSimplify/icons/petachem_full.png +0 -0
- molSimplify/icons/pythonlogo.png +0 -0
- molSimplify/icons/sge copy.png +0 -0
- molSimplify/icons/sge.png +0 -0
- molSimplify/icons/slurm.png +0 -0
- molSimplify/icons/wft1.png +0 -0
- molSimplify/icons/wft2.png +0 -0
- molSimplify/icons/wft3.png +0 -0
- molSimplify/ml/__init__.py +0 -0
- molSimplify/ml/kernels.py +36 -0
- molSimplify/ml/layers.py +29 -0
- molSimplify/molscontrol/__init__.py +14 -0
- molSimplify/molscontrol/_version.py +521 -0
- molSimplify/molscontrol/clf_tools.py +144 -0
- molSimplify/molscontrol/data/README.md +21 -0
- molSimplify/molscontrol/data/look_and_say.dat +15 -0
- molSimplify/molscontrol/dynamic_classifier.py +514 -0
- molSimplify/molscontrol/io_tools.py +363 -0
- molSimplify/molscontrol/molscontrol.py +49 -0
- molSimplify/molscontrol/terachem/jobscript_control.sh +31 -0
- molSimplify/molscontrol/terachem/terachem_input +22 -0
- molSimplify/python_krr/X_train_TS.csv +535 -0
- molSimplify/python_krr/__init__.py +0 -0
- molSimplify/python_krr/hat2_X_mean_std.csv +3 -0
- molSimplify/python_krr/hat2_feature_names.csv +1 -0
- molSimplify/python_krr/hat2_y_mean_std.csv +2 -0
- molSimplify/python_krr/hat_X_mean_std.csv +6 -0
- molSimplify/python_krr/hat_feature_names.csv +1 -0
- molSimplify/python_krr/hat_krr_X_train.csv +5205 -0
- molSimplify/python_krr/hat_krr_dual_coef.csv +1 -0
- molSimplify/python_krr/hat_y_mean_std.csv +2 -0
- molSimplify/python_krr/sklearn_models.py +34 -0
- molSimplify/python_krr/y_train_TS.csv +535 -0
- molSimplify/python_nn/ANN.py +198 -0
- molSimplify/python_nn/__init__.py +0 -0
- molSimplify/python_nn/clf_analysis_tool.py +125 -0
- molSimplify/python_nn/dictionary_toolbox.py +49 -0
- molSimplify/python_nn/ensemble_test.py +309 -0
- molSimplify/python_nn/hs_center.csv +26 -0
- molSimplify/python_nn/hs_scale.csv +26 -0
- molSimplify/python_nn/ls_center.csv +26 -0
- molSimplify/python_nn/ls_scale.csv +26 -0
- molSimplify/python_nn/ms_hs_b1.csv +50 -0
- molSimplify/python_nn/ms_hs_b2.csv +50 -0
- molSimplify/python_nn/ms_hs_b3.csv +1 -0
- molSimplify/python_nn/ms_hs_w1.csv +50 -0
- molSimplify/python_nn/ms_hs_w2.csv +50 -0
- molSimplify/python_nn/ms_hs_w3.csv +1 -0
- molSimplify/python_nn/ms_ls_b1.csv +50 -0
- molSimplify/python_nn/ms_ls_b2.csv +50 -0
- molSimplify/python_nn/ms_ls_b3.csv +1 -0
- molSimplify/python_nn/ms_ls_w1.csv +50 -0
- molSimplify/python_nn/ms_ls_w2.csv +50 -0
- molSimplify/python_nn/ms_ls_w3.csv +1 -0
- molSimplify/python_nn/ms_slope_b1.csv +50 -0
- molSimplify/python_nn/ms_slope_b2.csv +50 -0
- molSimplify/python_nn/ms_slope_b3.csv +1 -0
- molSimplify/python_nn/ms_slope_w1.csv +50 -0
- molSimplify/python_nn/ms_slope_w2.csv +50 -0
- molSimplify/python_nn/ms_slope_w3.csv +1 -0
- molSimplify/python_nn/ms_split_b1.csv +50 -0
- molSimplify/python_nn/ms_split_b2.csv +50 -0
- molSimplify/python_nn/ms_split_b3.csv +1 -0
- molSimplify/python_nn/ms_split_w1.csv +50 -0
- molSimplify/python_nn/ms_split_w2.csv +50 -0
- molSimplify/python_nn/ms_split_w3.csv +1 -0
- molSimplify/python_nn/slope_center.csv +25 -0
- molSimplify/python_nn/slope_scale.csv +25 -0
- molSimplify/python_nn/split_center.csv +26 -0
- molSimplify/python_nn/split_scale.csv +26 -0
- molSimplify/python_nn/tf_ANN.py +762 -0
- molSimplify/python_nn/train_data.csv +1211 -0
- molSimplify/tf_nn/__init__.py +0 -0
- molSimplify/tf_nn/geo_static_clf/geo_static_clf_model.h5 +0 -0
- molSimplify/tf_nn/geo_static_clf/geo_static_clf_train_name.csv +1591 -0
- molSimplify/tf_nn/geo_static_clf/geo_static_clf_train_x.csv +2790 -0
- molSimplify/tf_nn/geo_static_clf/geo_static_clf_train_y.csv +2790 -0
- molSimplify/tf_nn/geo_static_clf/geo_static_clf_vars.csv +154 -0
- molSimplify/tf_nn/geos/hs_ii_bl_x.csv +1577 -0
- molSimplify/tf_nn/geos/hs_ii_bl_y.csv +1577 -0
- molSimplify/tf_nn/geos/hs_ii_model.h5 +0 -0
- molSimplify/tf_nn/geos/hs_ii_model.json +1 -0
- molSimplify/tf_nn/geos/hs_ii_vars.csv +154 -0
- molSimplify/tf_nn/geos/hs_iii_bl_x.csv +1659 -0
- molSimplify/tf_nn/geos/hs_iii_bl_y.csv +1659 -0
- molSimplify/tf_nn/geos/hs_iii_model.h5 +0 -0
- molSimplify/tf_nn/geos/hs_iii_model.json +1 -0
- molSimplify/tf_nn/geos/hs_iii_vars.csv +154 -0
- molSimplify/tf_nn/geos/ls_ii_bl_x.csv +1374 -0
- molSimplify/tf_nn/geos/ls_ii_bl_y.csv +1374 -0
- molSimplify/tf_nn/geos/ls_ii_model.h5 +0 -0
- molSimplify/tf_nn/geos/ls_ii_model.json +1 -0
- molSimplify/tf_nn/geos/ls_ii_vars.csv +154 -0
- molSimplify/tf_nn/geos/ls_iii_bl_x.csv +1364 -0
- molSimplify/tf_nn/geos/ls_iii_bl_y.csv +1364 -0
- molSimplify/tf_nn/geos/ls_iii_model.h5 +0 -0
- molSimplify/tf_nn/geos/ls_iii_model.json +1 -0
- molSimplify/tf_nn/geos/ls_iii_vars.csv +154 -0
- molSimplify/tf_nn/homolumo/gap_model.h5 +0 -0
- molSimplify/tf_nn/homolumo/gap_model.json +1 -0
- molSimplify/tf_nn/homolumo/gap_test_names.csv +175 -0
- molSimplify/tf_nn/homolumo/gap_test_x.csv +176 -0
- molSimplify/tf_nn/homolumo/gap_test_y.csv +176 -0
- molSimplify/tf_nn/homolumo/gap_train_names.csv +699 -0
- molSimplify/tf_nn/homolumo/gap_train_x.csv +700 -0
- molSimplify/tf_nn/homolumo/gap_train_y.csv +700 -0
- molSimplify/tf_nn/homolumo/gap_vars.csv +153 -0
- molSimplify/tf_nn/homolumo/homo_model.h5 +0 -0
- molSimplify/tf_nn/homolumo/homo_model.json +126 -0
- molSimplify/tf_nn/homolumo/homo_test_names.csv +175 -0
- molSimplify/tf_nn/homolumo/homo_test_x.csv +176 -0
- molSimplify/tf_nn/homolumo/homo_test_y.csv +176 -0
- molSimplify/tf_nn/homolumo/homo_train_names.csv +699 -0
- molSimplify/tf_nn/homolumo/homo_train_x.csv +700 -0
- molSimplify/tf_nn/homolumo/homo_train_y.csv +700 -0
- molSimplify/tf_nn/homolumo/homo_vars.csv +153 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_info.json +7 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_model.h5 +0 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_model.json +1 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_test_names.csv +143 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_test_x.csv +144 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_test_y.csv +144 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_train_names.csv +513 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_train_x.csv +514 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_train_y.csv +514 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_val_names.csv +143 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_val_x.csv +58 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_val_y.csv +58 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_vars.csv +155 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_info.json +7 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_model.h5 +0 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_model.json +1 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_test_names.csv +143 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_test_x.csv +144 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_test_y.csv +144 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_train_names.csv +513 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_train_x.csv +514 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_train_y.csv +514 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_val_names.csv +143 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_val_x.csv +58 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_val_y.csv +58 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_vars.csv +154 -0
- molSimplify/tf_nn/oxocatalysis/hat_model.h5 +0 -0
- molSimplify/tf_nn/oxocatalysis/hat_model.json +1 -0
- molSimplify/tf_nn/oxocatalysis/hat_test_names.csv +419 -0
- molSimplify/tf_nn/oxocatalysis/hat_test_x.csv +420 -0
- molSimplify/tf_nn/oxocatalysis/hat_test_y.csv +420 -0
- molSimplify/tf_nn/oxocatalysis/hat_train_names.csv +1507 -0
- molSimplify/tf_nn/oxocatalysis/hat_train_x.csv +1508 -0
- molSimplify/tf_nn/oxocatalysis/hat_train_y.csv +1508 -0
- molSimplify/tf_nn/oxocatalysis/hat_val_x.csv +169 -0
- molSimplify/tf_nn/oxocatalysis/hat_val_y.csv +169 -0
- molSimplify/tf_nn/oxocatalysis/hat_vars.csv +162 -0
- molSimplify/tf_nn/oxocatalysis/oxo_model.h5 +0 -0
- molSimplify/tf_nn/oxocatalysis/oxo_model.json +1 -0
- molSimplify/tf_nn/oxocatalysis/oxo_test_names.csv +527 -0
- molSimplify/tf_nn/oxocatalysis/oxo_test_x.csv +528 -0
- molSimplify/tf_nn/oxocatalysis/oxo_test_y.csv +528 -0
- molSimplify/tf_nn/oxocatalysis/oxo_train_names.csv +1897 -0
- molSimplify/tf_nn/oxocatalysis/oxo_train_x.csv +1898 -0
- molSimplify/tf_nn/oxocatalysis/oxo_train_y.csv +1898 -0
- molSimplify/tf_nn/oxocatalysis/oxo_val_x.csv +212 -0
- molSimplify/tf_nn/oxocatalysis/oxo_val_y.csv +212 -0
- molSimplify/tf_nn/oxocatalysis/oxo_vars.csv +162 -0
- molSimplify/tf_nn/rescaling_data/gap_mean_x.csv +153 -0
- molSimplify/tf_nn/rescaling_data/gap_mean_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/gap_var_x.csv +153 -0
- molSimplify/tf_nn/rescaling_data/gap_var_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/geo_static_clf_mean_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/geo_static_clf_mean_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/geo_static_clf_var_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/geo_static_clf_var_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/hat_mean_x.csv +162 -0
- molSimplify/tf_nn/rescaling_data/hat_mean_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/hat_var_x.csv +162 -0
- molSimplify/tf_nn/rescaling_data/hat_var_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/homo_empty_mean_x.csv +155 -0
- molSimplify/tf_nn/rescaling_data/homo_empty_mean_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/homo_empty_var_x.csv +155 -0
- molSimplify/tf_nn/rescaling_data/homo_empty_var_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/homo_mean_x.csv +153 -0
- molSimplify/tf_nn/rescaling_data/homo_mean_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/homo_var_x.csv +153 -0
- molSimplify/tf_nn/rescaling_data/homo_var_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/hs_ii_mean_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/hs_ii_mean_y.csv +3 -0
- molSimplify/tf_nn/rescaling_data/hs_ii_var_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/hs_ii_var_y.csv +3 -0
- molSimplify/tf_nn/rescaling_data/hs_iii_mean_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/hs_iii_mean_y.csv +3 -0
- molSimplify/tf_nn/rescaling_data/hs_iii_var_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/hs_iii_var_y.csv +3 -0
- molSimplify/tf_nn/rescaling_data/ls_ii_mean_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/ls_ii_mean_y.csv +3 -0
- molSimplify/tf_nn/rescaling_data/ls_ii_var_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/ls_ii_var_y.csv +3 -0
- molSimplify/tf_nn/rescaling_data/ls_iii_mean_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/ls_iii_mean_y.csv +3 -0
- molSimplify/tf_nn/rescaling_data/ls_iii_var_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/ls_iii_var_y.csv +3 -0
- molSimplify/tf_nn/rescaling_data/oxo20_mean_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/oxo20_mean_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/oxo20_var_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/oxo20_var_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/oxo_mean_x.csv +162 -0
- molSimplify/tf_nn/rescaling_data/oxo_mean_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/oxo_var_x.csv +162 -0
- molSimplify/tf_nn/rescaling_data/oxo_var_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/sc_static_clf_mean_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/sc_static_clf_mean_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/sc_static_clf_var_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/sc_static_clf_var_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/split_mean_x.csv +155 -0
- molSimplify/tf_nn/rescaling_data/split_mean_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/split_var_x.csv +155 -0
- molSimplify/tf_nn/rescaling_data/split_var_y.csv +1 -0
- molSimplify/tf_nn/sc_static_clf/sc_static_clf_model.h5 +0 -0
- molSimplify/tf_nn/sc_static_clf/sc_static_clf_train_name.csv +1591 -0
- molSimplify/tf_nn/sc_static_clf/sc_static_clf_train_x.csv +1592 -0
- molSimplify/tf_nn/sc_static_clf/sc_static_clf_train_y.csv +1592 -0
- molSimplify/tf_nn/sc_static_clf/sc_static_clf_vars.csv +154 -0
- molSimplify/tf_nn/split/split_model.h5 +0 -0
- molSimplify/tf_nn/split/split_model.json +1 -0
- molSimplify/tf_nn/split/split_vars.csv +155 -0
- molSimplify/tf_nn/split/split_x.csv +1902 -0
- molSimplify/tf_nn/split/split_y.csv +1902 -0
- molSimplify/tf_nn/split/train_names.csv +1901 -0
- molSimplify/utils/__init__.py +0 -0
- molSimplify/utils/decorators.py +16 -0
- molSimplify/utils/metaclasses.py +12 -0
- molSimplify/utils/tensorflow.py +23 -0
- molSimplify/utils/timer.py +16 -0
- molSimplify-1.7.4.dist-info/LICENSE +674 -0
- molSimplify-1.7.4.dist-info/METADATA +821 -0
- molSimplify-1.7.4.dist-info/RECORD +651 -0
- molSimplify-1.7.4.dist-info/WHEEL +5 -0
- molSimplify-1.7.4.dist-info/entry_points.txt +3 -0
- molSimplify-1.7.4.dist-info/top_level.txt +4 -0
- tests/generateTests.py +122 -0
- tests/helperFuncs.py +658 -0
- tests/informatics/test_MOF_descriptors.py +128 -0
- tests/informatics/test_active_learning.py +113 -0
- tests/informatics/test_coulomb_analyze.py +24 -0
- tests/informatics/test_graph_racs.py +193 -0
- tests/ml/test_kernels.py +20 -0
- tests/ml/test_layers.py +47 -0
- tests/runtest.py +10 -0
- tests/test_Mol2D.py +128 -0
- tests/test_basic_imports.py +62 -0
- tests/test_bidentate.py +25 -0
- tests/test_cli.py +20 -0
- tests/test_distgeom.py +106 -0
- tests/test_example_1.py +29 -0
- tests/test_example_3.py +31 -0
- tests/test_example_5.py +43 -0
- tests/test_example_7.py +28 -0
- tests/test_example_8.py +15 -0
- tests/test_example_tbp.py +15 -0
- tests/test_ff_xtb.py +111 -0
- tests/test_geocheck_oct.py +26 -0
- tests/test_geocheck_one_empty.py +15 -0
- tests/test_geometry.py +44 -0
- tests/test_inparse.py +76 -0
- tests/test_io.py +84 -0
- tests/test_jobgen.py +84 -0
- tests/test_joption_pythonic.py +27 -0
- tests/test_ligand_assign.py +58 -0
- tests/test_ligand_assign_consistent.py +60 -0
- tests/test_ligand_class.py +26 -0
- tests/test_ligand_from_mol_file.py +35 -0
- tests/test_ligands.py +86 -0
- tests/test_mol3D.py +337 -0
- tests/test_molcas_caspt2.py +15 -0
- tests/test_molcas_casscf.py +15 -0
- tests/test_old_ANNs.py +68 -0
- tests/test_orca_ccsdt.py +15 -0
- tests/test_orca_dft.py +15 -0
- tests/test_qcgen.py +50 -0
- tests/test_racs.py +124 -0
- tests/test_rmsd.py +68 -0
- tests/test_structgen_functions.py +198 -0
- tests/test_tetrahedral.py +29 -0
- tests/test_tutorial_10_part_one.py +16 -0
- tests/test_tutorial_10_part_two.py +15 -0
- tests/test_tutorial_2.py +11 -0
- tests/test_tutorial_3.py +15 -0
- tests/test_tutorial_4.py +57 -0
- tests/test_tutorial_6.py +10 -0
- tests/test_tutorial_8.py +29 -0
- tests/test_tutorial_9_part_one.py +15 -0
- tests/test_tutorial_9_part_two.py +15 -0
- tests/test_tutorial_qm9_part_one.py +6 -0
- tests/testresources/refs/racs/generate_references.py +85 -0
- workflows/NandyJACSAu2022/bridge_functionalizer.py +253 -0
- workflows/NandyJACSAu2022/frag_functionalizer.py +242 -0
- workflows/NandyJACSAu2022/fragment_classes.py +586 -0
- workflows/NandyJACSAu2022/macrocycle_synthesis.py +179 -0
|
@@ -0,0 +1,701 @@
|
|
|
1
|
+
# @file cellbuilder_tools.py
|
|
2
|
+
# Contains routines for building unit cells with adsorbed species.
|
|
3
|
+
#
|
|
4
|
+
# Written by JP Janet for HJK Group
|
|
5
|
+
#
|
|
6
|
+
# Dpt of Chemical Engineering, MIT
|
|
7
|
+
|
|
8
|
+
import re
|
|
9
|
+
|
|
10
|
+
import numpy
|
|
11
|
+
try:
|
|
12
|
+
from openbabel import openbabel # version 3 style import
|
|
13
|
+
except ImportError:
|
|
14
|
+
import openbabel # fallback to version 2
|
|
15
|
+
import copy
|
|
16
|
+
from math import sqrt, pi
|
|
17
|
+
from molSimplify.Classes.globalvars import globalvars
|
|
18
|
+
from molSimplify.Classes.mol3D import mol3D
|
|
19
|
+
from molSimplify.Scripts.geometry import distance
|
|
20
|
+
# from scipy.spatial import Delaunay, ConvexHull
|
|
21
|
+
# import networkx as nx
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
###############################
|
|
25
|
+
# Main cell FF opt routine
|
|
26
|
+
#
|
|
27
|
+
# optimize complexes placed on cell to avoid clashes. Will use UFF for speed
|
|
28
|
+
#
|
|
29
|
+
# @param ff Force field to use, available MMFF94, UFF, Ghemical, GAFF,
|
|
30
|
+
# @param mol mol3D of cell to be optimized
|
|
31
|
+
# @param frozenats List of frozen atom indicies, will usually be the cell
|
|
32
|
+
# @return FF-calculated energy, mol3D of optimized cell
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def cell_ffopt(ff, mol, frozenats):
|
|
36
|
+
### FORCE FIELD OPTIMIZATION ##
|
|
37
|
+
# INPUT
|
|
38
|
+
# - ff: force field to use, available MMFF94, UFF< Ghemical, GAFF
|
|
39
|
+
# - mol: mol3D to be ff optimized
|
|
40
|
+
# OUTPUT
|
|
41
|
+
# - mol: force field optimized mol3D
|
|
42
|
+
metals = list(range(21, 31))+list(range(39, 49))+list(range(72, 81))
|
|
43
|
+
# check requested force field
|
|
44
|
+
ffav = 'mmff94, uff, ghemical, gaff, mmff94s' # force fields
|
|
45
|
+
if ff.lower() not in ffav:
|
|
46
|
+
print('Requested force field not available. Defaulting to UFF')
|
|
47
|
+
ff = 'UFF'
|
|
48
|
+
# convert mol3D to OBMol via xyz file, because AFTER/END option have coordinates
|
|
49
|
+
backup_mol = mol3D()
|
|
50
|
+
backup_mol.copymol3D(mol)
|
|
51
|
+
# print('bck ' + str(backup_mol.getAtom(0).coords()))
|
|
52
|
+
# print('mol_ibf ' + str(mol.getAtom(0).coords()))
|
|
53
|
+
mol.convert2OBMol()
|
|
54
|
+
# initialize constraints
|
|
55
|
+
constr = openbabel.OBFFConstraints()
|
|
56
|
+
# openbabel indexing starts at 1 ### !!!
|
|
57
|
+
# convert metals to carbons for FF
|
|
58
|
+
indmtls = []
|
|
59
|
+
mtlsnums = []
|
|
60
|
+
for iiat, atom in enumerate(openbabel.OBMolAtomIter(mol.OBMol)):
|
|
61
|
+
if atom.GetAtomicNum() in metals:
|
|
62
|
+
indmtls.append(iiat)
|
|
63
|
+
mtlsnums.append(atom.GetAtomicNum())
|
|
64
|
+
atom.SetAtomicNum(6)
|
|
65
|
+
for cat in frozenats:
|
|
66
|
+
constr.AddAtomConstraint(cat+1) # indexing babel
|
|
67
|
+
# set up forcefield
|
|
68
|
+
forcefield = openbabel.OBForceField.FindForceField(ff)
|
|
69
|
+
forcefield.Setup(mol.OBMol, constr)
|
|
70
|
+
# force field optimize structure
|
|
71
|
+
forcefield.ConjugateGradients(2500)
|
|
72
|
+
forcefield.GetCoordinates(mol.OBMol)
|
|
73
|
+
# reset atomic number to metal
|
|
74
|
+
for i, iiat in enumerate(indmtls):
|
|
75
|
+
mol.OBMol.GetAtomById(iiat).SetAtomicNum(mtlsnums[i])
|
|
76
|
+
mol.convert2mol3D()
|
|
77
|
+
en = forcefield.Energy()
|
|
78
|
+
|
|
79
|
+
del forcefield, constr
|
|
80
|
+
return mol, en
|
|
81
|
+
################################
|
|
82
|
+
###############################
|
|
83
|
+
# Import CIF to mol3D
|
|
84
|
+
#
|
|
85
|
+
# @param fst string of .cif file path
|
|
86
|
+
# @return mol3D of unit cell, cell vector
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def import_from_cif(fst, return_extra_cif_info=False):
|
|
90
|
+
# INPUT:
|
|
91
|
+
# fst: filename of cif file
|
|
92
|
+
# OUTPUT:
|
|
93
|
+
# unit_cell: mol3D class of a single unit cell
|
|
94
|
+
# cell_vector: list of lists of floats, each
|
|
95
|
+
# corresponds to one of the defining cell
|
|
96
|
+
# vectors
|
|
97
|
+
cell_vector = list()
|
|
98
|
+
unit_cell = mol3D()
|
|
99
|
+
A = 0
|
|
100
|
+
B = 0
|
|
101
|
+
C = 0
|
|
102
|
+
alpha = 0
|
|
103
|
+
beta = 0
|
|
104
|
+
emsg = list()
|
|
105
|
+
exit_status = 0
|
|
106
|
+
gamma = 0
|
|
107
|
+
obConversion = openbabel.OBConversion()
|
|
108
|
+
obConversion.SetInAndOutFormats("cif", "xyz")
|
|
109
|
+
mol = openbabel.OBMol()
|
|
110
|
+
if obConversion.ReadFile(mol, fst):
|
|
111
|
+
fillUC = openbabel.OBOp.FindType("fillUC")
|
|
112
|
+
fillUC.Do(mol, "strict")
|
|
113
|
+
unit_cell.OBMol = mol
|
|
114
|
+
unit_cell.convert2mol3D()
|
|
115
|
+
else:
|
|
116
|
+
emsg.append("Error in reading of cif file by openbabel")
|
|
117
|
+
exit_status = 1
|
|
118
|
+
with open(fst, errors='ignore') as f: # ignore takes care of unicode errors in some cifs
|
|
119
|
+
lines = f.readlines()
|
|
120
|
+
for line in lines:
|
|
121
|
+
linesplit = line.split()
|
|
122
|
+
if len(linesplit) != 0:
|
|
123
|
+
if linesplit[0] == "_cell_length_a":
|
|
124
|
+
A = float((re.sub(r'\([^)]*\)', '',
|
|
125
|
+
''.join(c for c in linesplit[1]))))
|
|
126
|
+
if linesplit[0] == "_cell_length_b":
|
|
127
|
+
B = float((re.sub(r'\([^)]*\)', '',
|
|
128
|
+
''.join(c for c in linesplit[1]))))
|
|
129
|
+
if linesplit[0] == "_cell_length_c":
|
|
130
|
+
C = float((re.sub(r'\([^)]*\)', '',
|
|
131
|
+
''.join(c for c in linesplit[1]))))
|
|
132
|
+
|
|
133
|
+
if linesplit[0] == "_cell_angle_alpha":
|
|
134
|
+
alpha = float(
|
|
135
|
+
''.join(c for c in linesplit[1] if c not in '()').rstrip('.'))
|
|
136
|
+
if linesplit[0] == "_cell_angle_beta":
|
|
137
|
+
beta = float(
|
|
138
|
+
''.join(c for c in linesplit[1] if c not in '()').rstrip('.'))
|
|
139
|
+
if linesplit[0] == "_cell_angle_gamma":
|
|
140
|
+
gamma = float(
|
|
141
|
+
''.join(c for c in linesplit[1] if c not in '()').rstrip('.'))
|
|
142
|
+
# create cell vectors
|
|
143
|
+
print(('cell vectors: ', 'alpha, beta, gamma = ' + str(alpha) +
|
|
144
|
+
', ' + str(beta) + ', ' + str(gamma)))
|
|
145
|
+
try:
|
|
146
|
+
cell_vector.append([A, 0, 0])
|
|
147
|
+
cell_vector.append([B*numpy.cos((gamma*pi)/180),
|
|
148
|
+
B*numpy.sin((gamma*pi)/180), 0])
|
|
149
|
+
cx = C*numpy.cos((beta*pi)/180)
|
|
150
|
+
cy = C*(numpy.cos((alpha*pi)/180)-numpy.cos((beta*pi)/180) *
|
|
151
|
+
numpy.cos((gamma*pi/180)))/numpy.sin((gamma*pi)/180)
|
|
152
|
+
cz = sqrt(C*C - cx*cx - cy*cy)
|
|
153
|
+
cell_vector.append([cx, cy, cz])
|
|
154
|
+
except ValueError: # Negative number in sqrt
|
|
155
|
+
emsg = emsg.append('Error in creating unit cell from cif informtation')
|
|
156
|
+
exit_status = 2
|
|
157
|
+
for i, rows in enumerate(cell_vector):
|
|
158
|
+
for j, elements in enumerate(rows):
|
|
159
|
+
if abs(elements) <= 1e-8:
|
|
160
|
+
cell_vector[i][j] = 0
|
|
161
|
+
if exit_status != 0:
|
|
162
|
+
return emsg
|
|
163
|
+
elif return_extra_cif_info:
|
|
164
|
+
return unit_cell, cell_vector, alpha, beta, gamma
|
|
165
|
+
else:
|
|
166
|
+
return unit_cell, cell_vector
|
|
167
|
+
##################################
|
|
168
|
+
# get center_of_sym CIF to mol3D
|
|
169
|
+
#
|
|
170
|
+
# @param list_of_points list of points
|
|
171
|
+
# @return csym center of sym
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
def center_of_sym(list_of_points):
|
|
175
|
+
n = len(list_of_points)
|
|
176
|
+
# print('lop = ' + str(list_of_points))
|
|
177
|
+
csym = [float(sum(x)/n) for x in zip(*list_of_points)]
|
|
178
|
+
return csym
|
|
179
|
+
# get sets min z coord of mol3D to zero
|
|
180
|
+
#
|
|
181
|
+
# @param super_cell mol3D of cell
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
def zero_z_csm(super_cell):
|
|
185
|
+
# puts center of sym
|
|
186
|
+
# at z = 0
|
|
187
|
+
csm = super_cell.centersym()
|
|
188
|
+
vec = [0, 0, 0]
|
|
189
|
+
vec[2] = -1*csm[2]
|
|
190
|
+
super_cell.translate(vec)
|
|
191
|
+
##################################
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
def xgcd(b, n):
|
|
195
|
+
# calculate x,y such that b*x + n*y = gcd(b,n)
|
|
196
|
+
# by extended Euclidean algorithm
|
|
197
|
+
x0, x1, y0, y1 = 1, 0, 0, 1
|
|
198
|
+
while n != 0:
|
|
199
|
+
q, b, n = b // n, n, b % n
|
|
200
|
+
x0, x1 = x1, x0 - q * x1
|
|
201
|
+
y0, y1 = y1, y0 - q * y1
|
|
202
|
+
return b, x0, y0
|
|
203
|
+
#
|
|
204
|
+
##################################
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
def distance_zw(r1, r2):
|
|
208
|
+
dx = r1[0] - r2[0]
|
|
209
|
+
dy = r1[1] - r2[1]
|
|
210
|
+
dz = 150*(r1[2] - r2[2])
|
|
211
|
+
d = sqrt(dx**2+dy**2+dz**2)
|
|
212
|
+
return d
|
|
213
|
+
##################################
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
def mdistance(r1, r2):
|
|
217
|
+
dx = r1[0] - r2[0]
|
|
218
|
+
dy = r1[1] - r2[1]
|
|
219
|
+
dz = r1[2] - r2[2]
|
|
220
|
+
d = sqrt(numpy.power(dx, 2) + numpy.power(dy, 2) + numpy.power(dz, 2))
|
|
221
|
+
return d
|
|
222
|
+
###################################
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
def get_basis_coefficients(point, basis):
|
|
226
|
+
# function to get basis set coefficients
|
|
227
|
+
# for an arbitrary point in a given (complete)
|
|
228
|
+
# basis set
|
|
229
|
+
coefficients = numpy.linalg.solve(
|
|
230
|
+
numpy.transpose(numpy.asarray(basis)), point)
|
|
231
|
+
return coefficients
|
|
232
|
+
###################################
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
def evaluate_basis_coefficients(coefficients, basis):
|
|
236
|
+
# get cartessian coords from basis set and
|
|
237
|
+
# coefficients
|
|
238
|
+
|
|
239
|
+
recons = [0, 0, 0]
|
|
240
|
+
for j in [0, 1, 2]:
|
|
241
|
+
recons = numpy.add(
|
|
242
|
+
recons, [coefficients[j]*numpy.asarray(basis[j][i]) for i in [0, 1, 2]])
|
|
243
|
+
return recons
|
|
244
|
+
###################################
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
def change_basis(mol, old_basis, new_basis):
|
|
248
|
+
new_mol = mol3D()
|
|
249
|
+
new_mol.copymol3D(mol)
|
|
250
|
+
point_coefficients = [get_basis_coefficients(
|
|
251
|
+
at.coords(), old_basis) for at in new_mol.getAtoms()]
|
|
252
|
+
new_points = [get_basis_coefficients(
|
|
253
|
+
point, new_basis) for point in point_coefficients]
|
|
254
|
+
for i, at in enumerate(new_mol.getAtoms()):
|
|
255
|
+
at.setcoords(new_points[i])
|
|
256
|
+
return new_mol
|
|
257
|
+
###################################
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
def normalize_vector(v):
|
|
261
|
+
length = distance(v, [0, 0, 0])
|
|
262
|
+
if length:
|
|
263
|
+
nv = [float(i)/length for i in v]
|
|
264
|
+
else:
|
|
265
|
+
nv = [0, 0, 0]
|
|
266
|
+
return nv
|
|
267
|
+
##############################
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
def threshold_basis(basis, threshold):
|
|
271
|
+
new_basis = [threshold_vector(i, threshold) for i in basis]
|
|
272
|
+
return new_basis
|
|
273
|
+
##############################
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
def threshold_vector(v, threshold):
|
|
277
|
+
nv = copy.copy(v)
|
|
278
|
+
for i, vi in enumerate(v):
|
|
279
|
+
if abs(vi) < threshold:
|
|
280
|
+
nv[i] = 0
|
|
281
|
+
return nv
|
|
282
|
+
##############################
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
def find_all_surface_atoms(super_cell, tol=1e-2, type_of_atom=False):
|
|
286
|
+
# Get all atoms on the tope surface - NB, this will
|
|
287
|
+
# not handle complex (2 or more) atom-type surfaces
|
|
288
|
+
# if the atoms are 'layered', e.g. TiO2 - Ti under O2,
|
|
289
|
+
# no Ti will be found. This can be overcome by using \
|
|
290
|
+
# a looser tolerance, such that the interlayer differences
|
|
291
|
+
# are smaller than tol, but not so large as to conflate
|
|
292
|
+
# different layers!
|
|
293
|
+
# INPUT:
|
|
294
|
+
# - super_cell: mol3D class that contains the super cell
|
|
295
|
+
# - tol: float, max distance from extent plane to look
|
|
296
|
+
# - type_of_atom: optional, string, gets atoms of the given type on the face plane
|
|
297
|
+
# if left out, will not care about types of atoms
|
|
298
|
+
# OUPUT
|
|
299
|
+
# - avail_sites_list: list of int, indices of atoms on the surface
|
|
300
|
+
#
|
|
301
|
+
extents = find_extents(super_cell)
|
|
302
|
+
target_height = extents[2]
|
|
303
|
+
avail_sites_list = list()
|
|
304
|
+
if type_of_atom:
|
|
305
|
+
possible_atom_inds = super_cell.findAtomsbySymbol(type_of_atom)
|
|
306
|
+
else:
|
|
307
|
+
possible_atom_inds = list(range(0, super_cell.natoms))
|
|
308
|
+
for indices in possible_atom_inds:
|
|
309
|
+
z_dist = abs(super_cell.getAtom(indices).coords()[2] - target_height)
|
|
310
|
+
if (z_dist <= tol):
|
|
311
|
+
avail_sites_list.append(indices)
|
|
312
|
+
|
|
313
|
+
return avail_sites_list
|
|
314
|
+
|
|
315
|
+
###################################
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
def distance_2d_torus(R1, R2, dim):
|
|
319
|
+
# distance between points in Euclidean torus
|
|
320
|
+
dx = abs(R1[0] - R2[0])
|
|
321
|
+
dy = abs(R1[1] - R2[1])
|
|
322
|
+
dz = abs((R1[2] - R2[2]))
|
|
323
|
+
d1 = sqrt(numpy.power(dim[0] - dx, 2)
|
|
324
|
+
+ numpy.power(dim[1] - dy, 2)
|
|
325
|
+
+ numpy.power(dz, 2))
|
|
326
|
+
d2 = sqrt(numpy.power(dim[0] - dx, 2)
|
|
327
|
+
+ numpy.power(dy, 2)
|
|
328
|
+
+ numpy.power(dz, 2))
|
|
329
|
+
d3 = sqrt(numpy.power(dx, 2)
|
|
330
|
+
+ numpy.power(dim[1] - dy, 2)
|
|
331
|
+
+ numpy.power(dz, 2))
|
|
332
|
+
d4 = sqrt(numpy.power(dx, 2)
|
|
333
|
+
+ numpy.power(dy, 2)
|
|
334
|
+
+ numpy.power(dz, 2))
|
|
335
|
+
d = min(d1, d2, d3, d4)
|
|
336
|
+
return d
|
|
337
|
+
###################################
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
def distance_2d_torus_next_only(R1, R2, dim):
|
|
341
|
+
# distance between points in Euclidean torus
|
|
342
|
+
dx = abs(R1[0] - R2[0])
|
|
343
|
+
dy = abs(R1[1] - R2[1])
|
|
344
|
+
dz = abs((R1[2] - R2[2]))
|
|
345
|
+
# print('dx,dy,dz'+str([dx,dy,dz]))
|
|
346
|
+
d1 = sqrt(numpy.power(dim[0] - dx, 2)
|
|
347
|
+
+ numpy.power(dim[1] - dy, 2)
|
|
348
|
+
+ numpy.power(dz, 2))
|
|
349
|
+
d2 = sqrt(numpy.power(dim[0] - dx, 2)
|
|
350
|
+
+ numpy.power(dy, 2)
|
|
351
|
+
+ numpy.power(dz, 2))
|
|
352
|
+
d3 = sqrt(numpy.power(dx, 2)
|
|
353
|
+
+ numpy.power(dim[1] - dy, 2)
|
|
354
|
+
+ numpy.power(dz, 2))
|
|
355
|
+
# print('d1,d2,d3'+str([dx,dy,dz]))
|
|
356
|
+
|
|
357
|
+
d = min(d1, d2, d3)
|
|
358
|
+
return d
|
|
359
|
+
#
|
|
360
|
+
################################################################
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
def periodic_2d_distance(R1, R2, cell_vector):
|
|
364
|
+
# distance between points in Euclidean torus
|
|
365
|
+
# STILL UNDER CONSTRUCTION, WIP WIP WIP ***
|
|
366
|
+
dx = abs(R1[0] - R2[0])
|
|
367
|
+
dy = abs(R1[1] - R2[1])
|
|
368
|
+
dz = abs((R1[2] - R2[2]))
|
|
369
|
+
for v1shifts in [-1, 0, 1]:
|
|
370
|
+
for v1shifts in [-1, 0, 1]:
|
|
371
|
+
for yshifts in [-1, 0, 0]:
|
|
372
|
+
pass
|
|
373
|
+
d1 = sqrt(numpy.power(dim[0] - dx, 2) # noqa: F821 (under construction)
|
|
374
|
+
+ numpy.power(dim[1] - dy, 2) # noqa: F821 (under construction)
|
|
375
|
+
+ numpy.power(dz, 2))
|
|
376
|
+
d2 = sqrt(numpy.power(dim[0] - dx, 2) # noqa: F821 (under construction)
|
|
377
|
+
+ numpy.power(dy, 2)
|
|
378
|
+
+ numpy.power(dz, 2))
|
|
379
|
+
d3 = sqrt(numpy.power(dx, 2)
|
|
380
|
+
+ numpy.power(dim[1] - dy, 2) # noqa: F821 (under construction)
|
|
381
|
+
+ numpy.power(dz, 2))
|
|
382
|
+
d = min(d1, d2, d3)
|
|
383
|
+
return d
|
|
384
|
+
################################################################
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
def periodic_mindist(mol, surf, dim):
|
|
388
|
+
### calculates minimum distance between atoms in 2 molecules ###
|
|
389
|
+
# INPUT
|
|
390
|
+
# - mol: mol3D class, molecule
|
|
391
|
+
# - surf: mol3D class, the surface
|
|
392
|
+
# - dim: list of float, replication
|
|
393
|
+
# OUTPUT
|
|
394
|
+
# - mind: minimum distance between atoms of the 2 mol objects
|
|
395
|
+
mind = 1000
|
|
396
|
+
for atom1 in mol.getAtoms():
|
|
397
|
+
for atom0 in surf.getAtoms():
|
|
398
|
+
if (distance_2d_torus(atom1.coords(), atom0.coords(), dim) < mind):
|
|
399
|
+
mind = distance(atom1.coords(), atom0.coords())
|
|
400
|
+
return mind
|
|
401
|
+
################################################################
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
def periodic_selfdist(mol, dim):
|
|
405
|
+
### calculates minimum distance between atoms in 2 molecules ##
|
|
406
|
+
# INPUT
|
|
407
|
+
# - mol: mol3D class, molecule
|
|
408
|
+
# - dim: list of floats, replication
|
|
409
|
+
# OUTPUT
|
|
410
|
+
# - mind: minimum distance between atoms of the 2 mol and periodic
|
|
411
|
+
# images
|
|
412
|
+
mind = 1000
|
|
413
|
+
for ii, atom1 in enumerate(mol.getAtoms()):
|
|
414
|
+
for jj, atom0 in enumerate(mol.getAtoms()):
|
|
415
|
+
if (distance_2d_torus(atom1.coords(), atom0.coords(), dim) < mind) and (ii != jj):
|
|
416
|
+
mind = distance(atom1.coords(), atom0.coords())
|
|
417
|
+
return mind
|
|
418
|
+
|
|
419
|
+
##################################
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
def closest_torus_point(mol, dim):
|
|
423
|
+
min_dist = 1000
|
|
424
|
+
for atom1 in mol.getAtoms():
|
|
425
|
+
R1 = atom1.coords()
|
|
426
|
+
for atom2 in mol.getAtoms():
|
|
427
|
+
R2 = atom2.coords()
|
|
428
|
+
d = distance_2d_torus_next_only(R1, R2, dim)
|
|
429
|
+
if (d < min_dist):
|
|
430
|
+
min_dist = d
|
|
431
|
+
return min_dist
|
|
432
|
+
#################################
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
def check_top_layer_correct(super_cell, atom_type):
|
|
436
|
+
# remove the layer on
|
|
437
|
+
# top of the cell if
|
|
438
|
+
# wrong material is exposed
|
|
439
|
+
trimmed_cell = mol3D()
|
|
440
|
+
trimmed_cell.copymol3D(super_cell)
|
|
441
|
+
globs = globalvars()
|
|
442
|
+
elements = globs.elementsbynum()
|
|
443
|
+
print(('chekcing surface for ' + atom_type + '\n'))
|
|
444
|
+
if atom_type not in elements:
|
|
445
|
+
print("unkown surface type, unable to trim ")
|
|
446
|
+
return trimmed_cell
|
|
447
|
+
else:
|
|
448
|
+
stop_flag = False
|
|
449
|
+
counter = 0 # 3 tries max
|
|
450
|
+
while not stop_flag:
|
|
451
|
+
atom_type_surf = find_all_surface_atoms(
|
|
452
|
+
trimmed_cell, tol=1e-3, type_of_atom=atom_type)
|
|
453
|
+
top_surf = find_all_surface_atoms(
|
|
454
|
+
trimmed_cell, tol=1e-3, type_of_atom=False)
|
|
455
|
+
# print("top surf",top_surf)
|
|
456
|
+
# print("atom top surf",atom_type_surf)
|
|
457
|
+
if set(atom_type_surf) == set(top_surf):
|
|
458
|
+
print('match')
|
|
459
|
+
stop_flag = True
|
|
460
|
+
else:
|
|
461
|
+
counter += 1
|
|
462
|
+
trimmed_cell = shave_surface_layer(trimmed_cell, 1e-3)
|
|
463
|
+
if counter == 3:
|
|
464
|
+
print('unable to find target atom in 3 cuts')
|
|
465
|
+
stop_flag = True
|
|
466
|
+
return trimmed_cell
|
|
467
|
+
###############################
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
def shave_surface_layer(super_cell, TOL=1e-1):
|
|
471
|
+
# dlist = fractionate_points_by_plane(super_cell,n)
|
|
472
|
+
# points_below_plane(point,n,refd)
|
|
473
|
+
|
|
474
|
+
shaved_cell = mol3D()
|
|
475
|
+
shaved_cell.copymol3D(super_cell)
|
|
476
|
+
extents = find_extents(super_cell)
|
|
477
|
+
zmax = extents[2]
|
|
478
|
+
del_list = list()
|
|
479
|
+
for i, atoms in enumerate(super_cell.getAtoms()):
|
|
480
|
+
coords = atoms.coords()
|
|
481
|
+
if abs(coords[2] - zmax) < TOL:
|
|
482
|
+
del_list.append(i)
|
|
483
|
+
shaved_cell.deleteatoms(del_list)
|
|
484
|
+
return shaved_cell
|
|
485
|
+
###############################
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
def shave_under_layer(super_cell):
|
|
489
|
+
shaved_cell = mol3D()
|
|
490
|
+
shaved_cell.copymol3D(super_cell)
|
|
491
|
+
TOL = 1e-1
|
|
492
|
+
zmin = 1000
|
|
493
|
+
for i, atoms in enumerate(super_cell.getAtoms()):
|
|
494
|
+
coords = atoms.coords()
|
|
495
|
+
if (coords[2] < zmin):
|
|
496
|
+
zmin = coords[2]
|
|
497
|
+
del_list = list()
|
|
498
|
+
for i, atoms in enumerate(super_cell.getAtoms()):
|
|
499
|
+
coords = atoms.coords()
|
|
500
|
+
if abs(coords[2] - zmin) < TOL:
|
|
501
|
+
del_list.append(i)
|
|
502
|
+
shaved_cell.deleteatoms(del_list)
|
|
503
|
+
return shaved_cell
|
|
504
|
+
###############################
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
def shave__type(super_cell, dim, mode):
|
|
508
|
+
## dim = 0,1,2
|
|
509
|
+
# x,y,z
|
|
510
|
+
# mode = 1 for max, -1 for min
|
|
511
|
+
shaved_cell = mol3D()
|
|
512
|
+
shaved_cell.copymol3D(super_cell)
|
|
513
|
+
TOL = 1e-1
|
|
514
|
+
|
|
515
|
+
dim_ref = 1000
|
|
516
|
+
|
|
517
|
+
del_list = []
|
|
518
|
+
if (mode == -1):
|
|
519
|
+
for i, atoms in enumerate(super_cell.getAtoms()):
|
|
520
|
+
coords = atoms.coords()
|
|
521
|
+
if (coords[dim] < dim_ref):
|
|
522
|
+
dim_ref = coords[dim]
|
|
523
|
+
for i, atoms in enumerate(super_cell.getAtoms()):
|
|
524
|
+
coords = atoms.coords()
|
|
525
|
+
if abs(coords[dim] - dim_ref) < TOL:
|
|
526
|
+
del_list.append(i)
|
|
527
|
+
elif (mode == 1):
|
|
528
|
+
extents = find_extents(super_cell)
|
|
529
|
+
dim_max = extents[dim]
|
|
530
|
+
for i, atoms in enumerate(super_cell.getAtoms()):
|
|
531
|
+
coords = atoms.coords()
|
|
532
|
+
if abs(coords[dim] - dim_max) < TOL:
|
|
533
|
+
del_list.append(i)
|
|
534
|
+
# return
|
|
535
|
+
shaved_cell.deleteatoms(del_list)
|
|
536
|
+
return shaved_cell
|
|
537
|
+
###############################
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
def zero_z(super_cell):
|
|
541
|
+
zeroed_cell = mol3D()
|
|
542
|
+
zeroed_cell.copymol3D(super_cell)
|
|
543
|
+
zmin = 1000
|
|
544
|
+
for i, atoms in enumerate(super_cell.getAtoms()):
|
|
545
|
+
coords = atoms.coords()
|
|
546
|
+
if (coords[2] < zmin):
|
|
547
|
+
zmin = coords[2]
|
|
548
|
+
zeroed_cell.translate([0, 0, -1*zmin])
|
|
549
|
+
return zeroed_cell
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
def zero_x(super_cell):
|
|
553
|
+
zeroed_cell = mol3D()
|
|
554
|
+
zeroed_cell.copymol3D(super_cell)
|
|
555
|
+
xmin = 1000
|
|
556
|
+
for i, atoms in enumerate(super_cell.getAtoms()):
|
|
557
|
+
coords = atoms.coords()
|
|
558
|
+
if (coords[0] < xmin):
|
|
559
|
+
xmin = coords[0]
|
|
560
|
+
zeroed_cell.translate([-1*xmin, 0, 0])
|
|
561
|
+
return zeroed_cell
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
def zero_y(super_cell):
|
|
565
|
+
zeroed_cell = mol3D()
|
|
566
|
+
zeroed_cell.copymol3D(super_cell)
|
|
567
|
+
ymin = 1000
|
|
568
|
+
for i, atoms in enumerate(super_cell.getAtoms()):
|
|
569
|
+
coords = atoms.coords()
|
|
570
|
+
if (coords[1] < ymin):
|
|
571
|
+
ymin = coords[1]
|
|
572
|
+
zeroed_cell.translate([0, -1*ymin, 0])
|
|
573
|
+
return zeroed_cell
|
|
574
|
+
|
|
575
|
+
###############################
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
def point_in_box(point, box):
|
|
579
|
+
outcome = False
|
|
580
|
+
fx = (box[0][0] <= point[0])*(point[0] < box[0][1])
|
|
581
|
+
fy = (box[1][0] <= point[1])*(point[1] < box[1][1])
|
|
582
|
+
fz = (box[2][0] <= point[2])*(point[2] < box[2][1])
|
|
583
|
+
if fz and fy and fx:
|
|
584
|
+
outcome = True
|
|
585
|
+
return outcome
|
|
586
|
+
##############################
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
def apply_plane_to_point(point, n):
|
|
590
|
+
dplane = sum([n[i]*point[i] for i in [0, 1, 2]])
|
|
591
|
+
return dplane
|
|
592
|
+
##############################
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
def fractionate_points_by_plane(super_cell, n, tol=1E-8):
|
|
596
|
+
vals = list()
|
|
597
|
+
for i, atoms in enumerate(super_cell.getAtoms()):
|
|
598
|
+
coords = atoms.coords()
|
|
599
|
+
this_frac = apply_plane_to_point(coords, n)
|
|
600
|
+
if len(vals) > 0:
|
|
601
|
+
# compare to seen values
|
|
602
|
+
these_dists = [abs(this_frac-j) for j in vals]
|
|
603
|
+
if min(these_dists) < tol:
|
|
604
|
+
pass
|
|
605
|
+
# print('have this point')
|
|
606
|
+
else:
|
|
607
|
+
vals.append(this_frac)
|
|
608
|
+
print(('new point at ' + str(this_frac)))
|
|
609
|
+
else:
|
|
610
|
+
vals.append(this_frac)
|
|
611
|
+
return vals
|
|
612
|
+
##############################
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
def points_below_plane(point, n, refd):
|
|
616
|
+
dplane = apply_plane_to_point(point, n) # noqa: F841 (under construction)
|
|
617
|
+
if abs(d-refd) < 1E-6: # noqa: F821 (under construction)
|
|
618
|
+
outcome = False
|
|
619
|
+
elif d < dref: # noqa: F821 (under construction)
|
|
620
|
+
outcome = True
|
|
621
|
+
else:
|
|
622
|
+
outcome = False
|
|
623
|
+
return outcome
|
|
624
|
+
#################################
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
def freeze_bottom_n_layers(super_cell, n):
|
|
628
|
+
frozen_cell = mol3D()
|
|
629
|
+
frozen_cell.copymol3D(super_cell)
|
|
630
|
+
counter = 0
|
|
631
|
+
while counter < n:
|
|
632
|
+
frozen_cell_new = freeze_under_layer(frozen_cell)
|
|
633
|
+
frozen_cell = mol3D()
|
|
634
|
+
frozen_cell.copymol3D(frozen_cell_new)
|
|
635
|
+
counter += 1
|
|
636
|
+
return frozen_cell
|
|
637
|
+
###############################
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
def freeze_under_layer(super_cell):
|
|
641
|
+
frozen_cell = mol3D()
|
|
642
|
+
frozen_cell.copymol3D(super_cell)
|
|
643
|
+
TOL = 1.5
|
|
644
|
+
zmin = 1000
|
|
645
|
+
for i, atoms in enumerate(super_cell.getAtoms()):
|
|
646
|
+
coords = atoms.coords()
|
|
647
|
+
if not atoms.frozen:
|
|
648
|
+
if (coords[2] < zmin):
|
|
649
|
+
zmin = coords[2]
|
|
650
|
+
freeze_list = list()
|
|
651
|
+
# print('lowest ' + str(zmin))
|
|
652
|
+
for i, atoms in enumerate(super_cell.getAtoms()):
|
|
653
|
+
coords = atoms.coords()
|
|
654
|
+
if not atoms.frozen:
|
|
655
|
+
if abs(coords[2] - zmin) < TOL:
|
|
656
|
+
freeze_list.append(i)
|
|
657
|
+
# print("freezing at " + str(coords))
|
|
658
|
+
frozen_cell.freezeatoms(freeze_list)
|
|
659
|
+
return frozen_cell
|
|
660
|
+
##############################
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
def find_extents(super_cell):
|
|
664
|
+
# INPUT
|
|
665
|
+
# - super_cell: mol3D class that contains the super cell
|
|
666
|
+
# OUPUT
|
|
667
|
+
# - extents: list of max coords of atoms on the surface
|
|
668
|
+
xmax = 0
|
|
669
|
+
zmax = 0
|
|
670
|
+
ymax = 0
|
|
671
|
+
for atoms in super_cell.getAtoms():
|
|
672
|
+
coords = atoms.coords()
|
|
673
|
+
x_ext = coords[0] # + atoms.rad
|
|
674
|
+
y_ext = coords[1] # + atoms.rad
|
|
675
|
+
z_ext = coords[2] # + atoms.rad
|
|
676
|
+
xmax = max(xmax, x_ext)
|
|
677
|
+
ymax = max(ymax, y_ext)
|
|
678
|
+
zmax = max(zmax, z_ext)
|
|
679
|
+
extents = [xmax, ymax, zmax]
|
|
680
|
+
return extents
|
|
681
|
+
#####################################
|
|
682
|
+
|
|
683
|
+
|
|
684
|
+
def find_extents_cv(super_cell_vector):
|
|
685
|
+
# INPUT
|
|
686
|
+
# - super_cell_vector: matrix of the three vectors that define the super cell
|
|
687
|
+
# OUPUT
|
|
688
|
+
# - extents: list of max coords of the super cell
|
|
689
|
+
xmax = 0
|
|
690
|
+
zmax = 0
|
|
691
|
+
ymax = 0
|
|
692
|
+
for columns in super_cell_vector:
|
|
693
|
+
xmax = max(xmax, abs(columns[0]))
|
|
694
|
+
ymax = max(ymax, abs(columns[1]))
|
|
695
|
+
zmax = max(zmax, abs(columns[2]))
|
|
696
|
+
xmax = numpy.linalg.norm(super_cell_vector[0])
|
|
697
|
+
ymax = numpy.linalg.norm(super_cell_vector[1])
|
|
698
|
+
zmax = numpy.linalg.norm(super_cell_vector[2])
|
|
699
|
+
|
|
700
|
+
extents = [xmax, ymax, zmax]
|
|
701
|
+
return extents
|