Driver

class openfts.driver.ComplexLangevin(dt=None, nsteps=None, output_freq=None, output_fields_freq=None, block_size=None, field_updater=None, variable_cell=None, resume=None)

Driver used for Complex Langevin simulations

Parameters:
  • dt (float) – Timestep used for field relaxations relaxation

  • nsteps (int) – Number of steps to run for

  • output_freq (int) – Frequency of outputs to stdout and to scalar files

  • output_fields_freq (int) – Frequency of outputs of field files (Default: equal to output_freq). Note that writing field files is fairly slow, so less frequent field output will result in better performance.

  • block_size (int) – How many timesteps are averaged into a block. See Block Averaging section in Operator documentation.

  • field_updater (FieldUpdater object) – Algorithm used to update fields. See FieldUpdater.

  • variable_cell (VariableCell object) – Optional argument. If defined, then perform variable cell calculation. See VariableCell and Variable Cell Formalism.

  • resume (bool) – Whether to resume run from existing operator/field files in the current directory. Useful for restarting/continuing simulations. Default: False.

Example (python)

# for Complex Langevin
fts.driver = openfts.driver.ComplexLangevin(dt=0.1,nsteps=3000,block_size=100,output_freq=100)
class openfts.driver.SCFT(dt=None, nsteps=None, output_freq=None, output_fields_freq=None, block_size=None, field_updater=None, variable_cell=None, resume=None, stop_tolerance=None)

Driver used for SCFT simulations

Parameters:
  • dt (float) – Timestep used for field relaxations relaxation

  • nsteps (int) – Number of steps to run for

  • output_freq (int) – Frequency of outputs to stdout and to scalar files

  • output_fields_freq (int) – Frequency of outputs of field files (Default: equal to output_freq). Note that writing field files is fairly slow, so less frequent field output will result in better performance.

  • block_size (int) – How many timesteps are averaged into a block. See Block Averaging section in Operator documentation.

  • field_updater (FieldUpdater object) – Algorithm used to update fields. See FieldUpdater.

  • variable_cell (VariableCell object) – Optional argument. If defined, then perform variable cell calculation. See VariableCell and Variable Cell Formalism.

  • resume (bool) – Whether to resume run from existing operator/field files in the current directory. Useful for restarting/continuing simulations. Default: False.

  • stop_tolerance (float) – Error tolerance for SCFT convergence. Run stops when this error is reached (assuming other stopping criteria are met).

Example (python)

# for SCFT with variable cell
fts.driver = openfts.driver.SCFT(dt=5.0,nsteps=5000,output_freq=100,stop_tolerance=1e-05)
fts.driver.variable_cell = openfts.VariableCell(lambda_=0.1,stop_tolerance=1e-4,update_freq=10,shape_constraint='none')
fts.driver.field_updater = openfts.field_updater.( ... see Field Updaters ... )

Example (json)

"driver": {
  "dt": 5.0,
  "field_updater": {
    ... see Field Updaters ...
  },

  "nsteps": 4000,
  "output_freq": 100,
  "type": "SCFT",
  "stop_tolerance": 1e-5,
  "variable_cell" :{
    "lambda": 0.1,
    "stop_tolerance": 1e-4,
    "update_freq": 10,
    "shape_constraint": "none"
  }
},
class openfts.driver.RPA(dt=None, nsteps=None, output_freq=None, output_fields_freq=None, block_size=None, field_updater=None, variable_cell=None, resume=None)

Driver RPA

(WIP) Here use random-phase approximation to evaluate operators.

class openfts.driver.ParticleMap(file_prefix=None, simulation_type=None, seed=None, rcut=None, rcut_units=None, alpha_ewald=None, table_exponent=None, widom_insertions=None)

Particle Map Driver

Parameters:
  • file_prefix (string) – file prefix to use for generated MD input files. Default: polymer.

  • simulation_type (string) – type of MD simulation to initialize. Either lammps or hoomd (See below).

  • seed (int) – random seed used to generate particle coordinates. If unspecified, one is generated randomly using hardware entropy source (i.e., std::random_device)

  • rcut (float) – pair cutoff to write to MD input files.

  • rcut_units (str) – units of provided rcut. Can either be b or Rg.

  • alpha_ewald (float) – \(\alpha_E\) parameter used to separate real and reciprocal space solutions of Coulombic interactions with Ewald sumations or PPPM. Units are given in \(1/b_{ref}\) (where at the moment \(b_{ref}\) must = 1). See Deserno and Holm for many considerations in setting this parameter. Note, this parameter should only be specified for models with charged interactions.

  • table_exponent (float) – exponent used for tabulated pair potentials. Total table length is \(2^X\). Typically only used for Coulombic interactions to compatibilize the regularized Coulomb pair potentials with the default Ewald/PPPM solvers in LAMMPS/HOOMD. See Kiss2013/McCarty2019 for more details.

  • widom_insertions (int) – generate specified number of random configurations that can be used for widom insertions to calculate the chemical potential. If input argument is not zero, these configurations are written to <file_prefix>_molX.dat where X is the molecule index. Default: 0 (do not generate any insertions).

Note

Prior versions of the code used rcut in units of a, the smearing length of the model in units of b. If you have old input files that used this prior convention, you will need to convert to the new convention. If your old rcut was given by X, then your new rcut arguments will be rcut=X*atilde, rcut_units=”Rg” where atilde is the smearing length in units of Rg. The old code also defaulted to \(X=4.5\sqrt{2}\) (Yes, this is a very odd default value. There is a reason the current code only accepts rcut in units of b or Rg).

  • run-hoomd3-widom.py - a HOOMD input script that is optionally generated if !=0 and simulation_type=”hoomd”. This script can be used to calculate the chemical potential using widom insertions into an existing HOOMD trajectory. See script internals for details.

simulation_type=”lammps” generates:
  • polymer.xyz: xyz coordinates of particles, not used by LAMMPS but can be helpful for initial visualization

  • polymer.psf: topology of generated configuration

  • polymer.data: a LAMMPS read_data file containing particle positions, bonds and box dimensions

  • polymer.coeff: interaction styles and coefficients for easy import into LAMMPS script using include command

  • in.lammps: a LAMMPS input script for actually running a simulation.

simulation_type=”hoomd” generates:
  • polymer.gsd: gsd file that contains coordinates and topology of initial configuration

  • polymer.json: json file with coefficients for easy import into a python/HOOMD input script

  • run-hoomd3.py: a HOOMD input script for actually running a simulation