generate_input_linear_approximation

generate_alchemical_lammps_inputs.generate_alchemical_lammps_inputs.generate_input_linear_approximation(parameter_range, parameter_change, fix_adapt_changes, temperature, types_solute, types_solvent, n_run_equil_steps=1000000, n_run_prod_steps=1000000, output_frequency=1000, output_file=None, fix_adapt_changes2=None, parameter2_value=None, is_charged=True, parameter_array=None)[source]

Outputs the section of a LAMMPS input file that separates the Coulomb, nonbonded, and bond/angle/torsional contributions of the solute and solvent. As long as the parameter being changed is linearly dependent on the potential energy, these files for each value of the parameter can be used for thermodynamic integration (TI) or multi-state Bennett acceptance ratio (MBAR).

The input data file for this script should be an equilibrated frame in the NPT ensemble. Notice that the input file contains the following keywords that you might replace with the values for your simulation using sed: TEMP, PRESS

Parameters:
  • parameter_range (list[float]) – Range of parameter values to be changed where the first value should be the value with which the system has been equilibrated.

  • parameter_change (float) – The size of the step between parameter values, where a positive value increases and a negative value decreases. Take care that number of points needed to traverse the given range should result in an integer, otherwise LAMMPS will not end at the desired value.

  • fix_adapt_changes (list) – A list of lists containing the following information from fix adapt/fep: attribute (str), args (tuple), e.g., [[“pair”, (“lj/cut/soft”, “lambda”, 1, 2)]]. The attributes supported in LAMMPS are:

    • pair; arguments are: pair_style parameter solvent_type(s) solute_type(s)

      • pair_style (str) : String of LAMMPS pair style being changes

      • parameter (str) : Parameter being varied, see table in compute fep for the options in your pair-potential

      • solvent_type (str) : String defining atom types in the solvent (no spaces), lists are denoted with an asterisk

      • solute_type (str) : String defining atom types in the solute (no spaces), lists are denoted with an asterisk

    • atom; arguments are: parameter atom_type(s). These lines will be scaled by the variation of a “lambda” parameter

      whose range is defined in parameter_range, where the starting and end points are multiplied by variable_initial.

      • parameter (str) : Parameter being varied, see table in compute fep for the options in your pair-potential

      • atom_type (str) : String defining atom types being affected, lists are denoted with an asterisk

      • variable_initial (float) : Specify the initial value of the variable

  • temperature (float) – Temperature of the simulation. This will create a variable that is used in the FEP computes.

  • types_solvent (str) – String defining all atom types in the solvent (no spaces) with lists defined using colons

  • types_solute (str) – String defining all atom types in the solute (no spaces) with lists defined using colons

  • n_run_equil_steps (int, default=1000000) – Number of steps in each equilibration run, first with a ramp from the old lambda value to the new value and then for equilibration at the new value. The total number of time steps taken per step in lambda (i.e., window) is 2*n_run_equil_steps + n_run_prod_steps

  • n_run_prod_steps (int, default=1000000) – Number of steps in each production run. The total number of time steps taken per step in lambda (i.e., window) is 2*n_run_equil_steps + n_run_prod_steps

  • output_frequency (int, default=1000) – Number of steps between thermo output and dump output.

  • output_file (str, default=None) – File name and path for optional output file

  • fix_adapt_changes2 (list, default=[]) – A list of lists containing the following information from fix adapt/fep: attribute (str), args (tuple). This option is useful when a parameter that has been varied and is set to another value in this simulation, e.g., lambda when the Coulomb potential is set to zero. Using this feature avoids complications with writing the pair potential information in the data file. The attributes supported in LAMMPS are:

    • pair; arguments are: pair_style parameter solvent_type(s) solute_type(s)

      • pair_style (str) : String of LAMMPS pair style being changes

      • parameter (str) : Parameter being varied, see table in compute fep for the options in your pair-potential

      • solvent_type (str) : String defining atom types in the solvent (no spaces), lists are denoted with an asterisk

      • solute_type (str) : String defining atom types in the solute (no spaces), lists are denoted with an asterisk

    • atom; arguments are: parameter atom_type(s). These lines will be scaled by the variation of a “lambda” parameter

      whose range is defined in parameter_range, where the starting and end points are multiplied by variable_initial.

      • parameter (str) : Parameter being varied, see table in compute fep for the options such as “charge”

      • atom_type (str) : String defining atom types being affected, lists are denoted with an asterisk

      • variable_initial (float) : Specify the initial value of the variable

  • parameter2_value (str, default=None) – Value to set parameter2 in fix_adapt_changes2.

  • is_charged (bool, default=True) – This will add kspace components to the record of free energy changes

  • parameter_array (list, default=None) – If not None, this argument will overwrite the parameter_change argument and use the specified steps in the parameter. Note that the first value should represent the state that the trajectory is equilibrated at.

Returns:

file – List of strings representing lines in a file

Return type:

list[str]