The maximum flux transition path (MFTP) zeta = Z(s), s in [0,1], is defiend by the condition that $\beta \nabla F + \frac{(D(Z)^{-1}Z_s)_s}{Z_s^TD(Z)^{-1}Z_s} // D(Z)^{-1}Z_s$. We implemented the semi-implicit simplified string method for calculating the MFTP and the simplified string method for calculating the minimum free energy path (MFEP). The module mftp.py written in Python does such a job, in which "pathrefiner" is the principal function. The function is invoked on separate processors using mpi4py. ************************************************************************************* Input of pathrefiner: * 1. msys -- (OBJECT): defining the molecular system, including at least two * attributes: system temperature (a real number), and mean_force * (a function), and user-defined attributes (see example CHARMM). * 2. initpath -- (ARRAY): an initial path in collective variable space with dimension * (number of images) times (dimension of collective variables) * 3. param -- (DICTIONARY): {"noiter":1, "preiter":0, "tau":0.04, "TOL":0.02, * "method":MFEP_SS/MFTP_ISS}. In general, "noiter" is the maximum * iterations users specify for a continuous run; "preiter" allows * users to continue from the previous run; "tau" is the pseudo time * time square determining the moving speed; "TOL" is the stopping * criterion defined as d = max_{0<=j<=J}|x^current - x^previous|; * "method" means whether to calculate the MFEP or the MFTP. By default * is the MFTP. * Output of pathrefiner: * 1. tranpath -- (ARRAY): transition path with same dimension as initpath * 2. noiter -- (INTEGER): the actual number of iterations for one continuous run * ************************************************************************************* The interface between the developer code "pathrefiner" and user code is the system dependent function "mean_force". The function "mean_force" should at least provide the proto-diffusion tensor $D$ and the derivative of the free energy: $\nabla F$. ******************************************************************************* Input of "mean_force" contains at least: * 1. Z_j (ARRAY): the coordinates of j-th image in collective variable space * 2. j (INTEGER): the identity number of the image * 3. Molecular system parameters, such as temperature, pressure, etc. * Output of "mean_force" contains at least: * 1. D_j (ARRAY): proto-diffusion tensor at j-th images * 2. nabla F_j (ARRAR): the derivative of the free energy at j-th images * Remark: The values of cartesian coordinates at each iteration should be saved.* Or else, the input and output of "mean_force" could contain this arguments. * In CHARMM, it is manipulated by saving COORDINATE FILES. * ******************************************************************************* We demonstrate how to use the module mftp by three examples: 1. an artificial problem in which the collective variables are configurations; 2. alanine dipeptide in vacuum using CHARMM; 3. alanine dipeptide in vacuum using NAMD. We provide the module "utility" containing some functions to facilitate the examples. These functions are: 1. readpath -- read formatted path data file from disk 2. writepath -- write path data as formatted file into disk 3. plotpath -- visualize path For each example, run: mpirun -np x python main.py where "x" is the number of processors users provide.