This script performs the following tasks:
- Optimizes a monomer's geometry using Psi4.
- Calculates ESP and RESP charges.
- Builds a polymer using Pysimm.
- Please install Pysimm_by_SN from my repository and install it to run this code and add the below lines to your bashrc file.
- export LAMMPS_EXEC=path_to_your/lmp_mpi
- export PYTHONPATH=$PYTHONPATH:/path_to_your/pysimm
- export PATH=$PATH:/path_to_your/bin
- export ANTECHAMBER_EXEC=~/path_to_your/antechamber
- The script requires AMBER Tools to run. You can download and install it from AMBER's official site.
numpymathmdtrajpysimmpsi4resppandas
input_parameters.dat: This file should have 7 columns:- Index of the monomer's head atom (index starts from 1).
- Index of the monomer's tail atom.
- Hydrogen attached to the head atom of the monomer.
- Hydrogen attached to the tail atom of the monomer.
- Name of the molecule (Ensure the initial XYZ file of the monomer has the name format
{molecule_name}_initial.xyzand contains two remark lines at the beginning). - Flag to keep (0) or remove (1) unnecessary files during execution.
- Optimization flag:
- 1: Optimize and prepare the polymer.
- 0: Only build the polymer without optimizing.
{molecule_name}_initial.xyz: Initial monomer structure (from Avogadro or another tool).
-
Geometry Optimization:
- Uses Psi4 with the
scf/cc-pVDZmethod. - Produces optimized geometry in
{molecule_name}_optimized.xyz.
- Uses Psi4 with the
-
RESP Charge Calculation:
- Conducts ESP and RESP charge fitting.
- Outputs charges in the
.mol2file format for Pysimm.
-
Polymer Building:
- Builds a polymer using Pysimm's random walk algorithm.
- Caps polymers with hydrogen atoms if necessary.
- Minimizes the polymer structure.
- Outputs polymer configurations in
.lmpsformat.
- Prepare the
input_parameters.datfile and{molecule_name}_initial.xyzfile. - Run the script:
python script_name.py
### Input parameters for polymer building ###
#1. Index of head atom of the monomer (index starts from 1)
#2. Index of the tail atom of the monomer
#3. Hydrogen attached to the head atom of the monomer
#4. Hydrogen attached to the tail atom of the monomer
#5. Name of the molecule (You should remember that your initial xyz file of the monomer should have a name like {moleculename}_initial.xyz), also make sure xyz file have two remarks like in begining.
#6. To remove files set it to 1. To keep make it 0
#7. Flag to optimize or not, if 1 it will optimize, if 0 it will build the polymer...else not
### Sometimes, you may not have some parameters in your force-field database, then you have to modify gaff.json to include those.
21
38
26
40
SPEEK
0
1
- The script modifies the
gaff.jsonfile for force-field parameters if required. - Ensure sufficient memory and threads for Psi4:
psi4.set_memory('100 GB') psi4.set_num_threads(20)
- If force-field parameters are missing, update
gaff.jsonaccordingly. - Ensure the input XYZ file is properly formatted.
Supriyo Naskar Institute: ICGM, CNRS, ENSCM, University of Montpellier
Alejandro Diaz-Marquez, Supriyo Naskar, Dong Fan, Mohamed Eddaoudi, and Guillaume Maurin. "MOF surface morphology governs interfacial pore architecture and CO₂ dynamics in mixed matrix membranes." Chemical Science (2025).
