diff --git a/examples/QUANTUM/PySCF/README b/examples/QUANTUM/PySCF/README index 48cde06768..de5582df66 100644 --- a/examples/QUANTUM/PySCF/README +++ b/examples/QUANTUM/PySCF/README @@ -11,11 +11,11 @@ Step 4: Perform test runs in any of 3 modes Step 0: What PySCF currently supports -LATTE can be used with fix mdi/qmmm for QMMM simulations, but not with -fix mdi/qm to perform QM calculations of an entire system. For QMMM -it can use the direct mode of fix mdi/qmmm, but not the potential -mode. PySCF can calculate a QM energy and QM forces on each atom, but -it cannot compute a QM stress tensor. +PySCF can be used with fix mdi/qmmm for QM/MM simulations, but not with fix +mdi/qm to perform QM calculations of an entire system. For QM/MM it can use +the direct mode of fix mdi/qmmm, but not the plugin mode. PySCF can calculate +a QM energy and QM forces on each atom, but it cannot compute a QM stress +tensor. PySCF does not support MPI parallelism, so run it on a single MPI task. But it does support multi-threading via OpenMP. By default it will use @@ -66,32 +66,18 @@ CMake: --------------------------------- --------------------------------- -Step 2: Download/build MDI code coupling package +Step 2: Install MDI code coupling python module -(a) clone the MDI Git repo +You can install MDI in your Python environment via conda: -% mkdir mdi; cd mdi -% git clone git@github.com:MolSSI-MDI/MDI_Library.git git +% conda install -c conda-forge pymdi=1.4.16 -(b) build MDI +or via pip: -% cd mdi/git -% mkdir build; cd build -% cmake .. -% make -j +% pip install 'pymdi>=1.4.14' -(c) Add a line like this to your ~/.bashrc or ~/.cshrc file so that -Python can find MDI: - -For bash: - -% export PYTHONPATH="$PYTHONPATH:/home/sjplimp/mdi/git/build" -% hash -r - -For (t)csh: - -% setenv PYTHONPATH ${PYTHONPATH}:/home/sjplimp/mdi/git/build -% rehash +It is likely fine to leave off the version number, to get the latest +MDI version. 1.4.16 is the version LAMMPS is currently using. --------------------------------- --------------------------------- @@ -101,7 +87,7 @@ Step 3: Download/build PySCF See https://pyscf.org/install.html for install options. This describes building PySCF from source code. -(a) clone the PySCI Git repo +(a) clone the PySCF Git repo % mkdir pyscf; cd pyscf % git clone https://github.com/pyscf/pyscf.git git @@ -134,7 +120,7 @@ will need: % python >>> import numpy as np >>> from mpi4py import MPI ->>> import MDI_Library as mdi +>>> import mdi >>> import pyscf --------------------------------- @@ -149,9 +135,9 @@ in.mixture = QMMM of mixture, QM small molecule in MM water ** run LAMMPS-only versions of mixture problem -lmp_mpi -log log.mixture.mm.1 < in.mixture.mm +lmp_mpi -log log.mixture.mm.1 -in in.mixture.mm -** run LAMMPS and LATTE with TCP/IP, 1 proc each +** run LAMMPS and PySCF with TCP/IP, 1 proc each lmp_mpi -mdi "-name LMP -role DRIVER -method TCP -port 8021" -log log.water.qmmm.tcp.1 -in in.water.qmmm & python pyscf_mdi.py -mdi "-name PYSCF -role ENGINE -method TCP -port 8021 -hostname localhost" diff --git a/examples/QUANTUM/PySCF/in.water.qmmm b/examples/QUANTUM/PySCF/in.water.qmmm index 1b19ed9ab2..15fa30223f 100644 --- a/examples/QUANTUM/PySCF/in.water.qmmm +++ b/examples/QUANTUM/PySCF/in.water.qmmm @@ -36,7 +36,7 @@ velocity all create 300.0 87287 loop geom timestep 2.0 -fix 1 all nve +fix 1 all nve fix 2 qm mdi/qmmm direct elements O H fix_modify 2 energy yes @@ -45,4 +45,4 @@ thermo_style custom step cpu temp ke evdwl ecoul epair emol elong & f_2 pe etotal press thermo 1 -run 10 +run 10 diff --git a/examples/QUANTUM/PySCF/pyscf_mdi.py b/examples/QUANTUM/PySCF/pyscf_mdi.py index 193ada132f..9b0aeaaf03 100644 --- a/examples/QUANTUM/PySCF/pyscf_mdi.py +++ b/examples/QUANTUM/PySCF/pyscf_mdi.py @@ -532,12 +532,14 @@ def evaluate(): if periodic: cell = Cell() + cell.verbose = 4 cell.atom = atom_str cell.a = box_str cell.basis = basis cell.build() else: mol = Mole() + mol.verbose = 4 mol.atom = atom_str mol.basis = basis #mol.max_memory = 10000 @@ -555,8 +557,8 @@ def evaluate(): if mode == QMMM: if periodic: mf = RKS_pbc(cell,xc=xcstr) else: mf = RKS_nonpbc(mol,xc=xcstr) - mf = qmmm.mm_charge(mf,mm_coords,mm_charges,mm_radii) - + mf = qmmm.mm_charge(mf,mm_coords,mm_charges) + if dm_previous_exists: qm_pe = mf.kernel(dm0=dm_previous) else: