Skip to content

Releases: JuliaMolSim/Molly.jl

v0.23.2

13 Feb 18:26

Choose a tag to compare

New features

  • Support for virtual sites is added. OneParticleSite, TwoParticleAverageSite, ThreeParticleAverageSite and OutOfPlaneSite are available. Virtual sites can be involved in any interaction type.
  • Elements are now inferred more generally from atom names in structure files, for example "C2" is inferred as carbon.
  • The old "from/to" bond syntax in OpenMM force field XML files is supported.

v0.23.1

15 Jan 17:51

Choose a tag to compare

New features

  • Force field loading from OpenMM XML format is made more flexible and is now closer to OpenMM's behaviour. In particular, residues are matched to templates according to their molecular graph, meaning that there is more variability allowed in residue and atom naming. The rename_terminal_res argument during setup is no longer used.
  • Support for residue patches in OpenMM XML force field files is added.
  • Common bias potentials and collective variables (CVs) are added via BiasPotential, LinearBias, SquareBias, FlatBottomSquareBias, CalcDist, CalcRg and CalcRMSD. Alternatives can be defined by the user. Enzyme is used by default to calculate the gradient of the CV to obtain the force.

Bug fixes

  • A bug in the Lennard-Jones and Coulomb soft core potentials is fixed.
  • A bug in PME when using non-default parameters is fixed.
  • A bug when taking gradients with MonteCarloBarostat is fixed.

v0.23.0

01 Nov 19:46

Choose a tag to compare

Breaking changes

  • pressure and virial now return tensor quantities, e.g. 3x3 in 3D. The virial now takes into account all pairwise and specific interaction terms automatically. The virial is also supported for the Ewald and PME methods, but not constraints or implicit solvent methods. Custom general interactions can define a virial term if required. The scalar values can be calcuated with scalar_pressure and scalar_virial, with the corresponding loggers ScalarPressureLogger and ScalarVirialLogger. The new forces_virial function allows calculation of both the forces and the virial at the same time, which can save computation. The kinetic_energy_tensor function allows the kinetic energy of a system in its tensorial form to be calculated. The needs_virial function should be defined for couplers that require virial computation.
  • All pairwise interactions should be a subtype of the abstract type PairwiseInteraction. This was previously removed but has been added back to allow dispatch to be used in the future.
  • General interactions should now define AtomsCalculators.forces! rather than AtomsCalculators.forces and should mutate the input forces, leading to fewer allocations. This means that the order of general interactions can matter and that general interactions can be used to modify forces directly.
  • LennardJonesSoftCore and CoulombSoftCore are removed and replaced with LennardJonesSoftCoreBeutler/LennardJonesSoftCoreGapsys and CoulombSoftCoreBeutler/CoulombSoftCoreGapsys, two popular soft core implementations.
  • MonteCarloAnisotropicBarostat and MonteCarloMembraneBarostat are removed as their functionality is now available using MonteCarloBarostat with the coupling_type keyword argument.
  • TrajectoryWriter and write_structure now keep molecules connected over the periodic boundaries by default. The correction keyword argument allows this to be controlled, with :wrap providing the previous behaviour.
  • StructureWriter, which wrote to the PDB format, is removed. TrajectoryWriter should be used to write to all file formats including PDB.
  • RescaleThermostat is renamed to ImmediateThermostat to better reflect what it does and to avoid confusion with the new VelocityRescaleThermostat.
  • The implicit_solvent keyword argument when setting up a system from a file now takes symbols rather than strings, e.g. :gbn2 instead of "gbn2", to increase consistency across the package.
  • The default nonbonded_method during setup is now :none, i.e. short range interactions, compared to the reaction field approximation used before (now available with :cutoff).
  • The dist_neighbors keyword argument during setup from a file is replaced with dist_buffer, a buffer distance added to dist_cutoff. This means that dist_cutoff can be changed without having to also update dist_buffer.
  • The arguments of apply_loggers! and apply_couplers! are changed.
  • AbstractGBSA, ResidueType, AtomType, PeriodicTorsionType, born_radii_and_grad, extract_parameters, inject_gradients and molecule_centers are no longer exported.
  • The type parameters of CubicBoundary, RectangularBoundary and TriclinicBoundary are changed.

New features

  • Ewald and particle mesh Ewald (PME) electrostatic summation methods are added as the Ewald and PME general interactions respectively, which should be used alongside the corresponding CoulombEwald pairwise interaction. PME runs on all backends and is compatible with Enzyme when the grad_safe option is given during system setup from a file. The nonbonded_method keyword argument during system setup from a file allows the electrostatic summation approach to be selected. The ewald_error_tol and approximate_pme keyword arguments are also added.
  • Constraints now work on the GPU and the documentation is improved. The constraints and rigid_water keyword arguments during system setup from a file allow different constraint options to be selected. The check_constraints function is added to check both position and velocity constraints.
  • The stochastic velocity rescaling thermostat is added as VelocityRescaleThermostat.
  • The stochastic cell rescaling barostat is added as CRescaleBarostat.
  • Non-isotropic pressure coupling is now available for the BerendsenBarostat with the coupling_type keyword argument.
  • The cutoff interface is now available for custom pairwise interactions with the use of force_cutoff and pe_cutoff. Documentation for custom cutoff methods is added.
  • Functions and documentation for calculating free energies with the Multistate Bennett Acceptance Ratio (MBAR) method are added.
  • The EnsembleSystem struct and read_frame! function are added to help with loading trajectory data into a System.
  • The DisplacementsLogger, useful for calculating properties such as mean squared displacements, is added.
  • The replica_boundaries keyword argument is added for ReplicaSystem.
  • The cutoff keyword argument is added for Gravity.
  • More informative errors are given during setup for incompatible arguments.

Performance improvements

  • GPU simulation is made faster.

Bug fixes

  • A bug when applying cutoffs is fixed.
  • A bug when using a TriclinicBoundary with CUDA is fixed.
  • A bug when using custom atom types with CUDA is fixed.
  • A rare bug in force calculation with CUDA is fixed.
  • Bugs when setting up a TriclinicBoundary with certain values are fixed.
  • A bug when using CellListMapNeighborFinder in 2D is fixed.

v0.22.3

04 Jul 11:57

Choose a tag to compare

Bug fixes

  • A bug when calculating the potential energy of a system using Measurements.jl is fixed.

v0.22.2

27 Jun 15:02

Choose a tag to compare

New features

  • write_structure is added to allow a system to be written to a file.
  • TrajectoryWriter now writes out better PDB files. StructureWriter is now an alias for TrajectoryWriter with the PDB format and will be removed in a future breaking release. It is recommended to replace instances of StructureWriter with TrajectoryWriter.
  • The excluded_res and write_boundary keyword arguments can now be given to TrajectoryWriter. The atom_inds keyword argument can now be given to StructureWriter.
  • AtomDatacan now store chain_id and hetero_atom, allowing better file writing.
  • The Urey-Bradley potential is added as UreyBradley.
  • The mixing functions waldman_hagler_σ_mixing, waldman_hagler_ϵ_mixing and fender_halsey_ϵ_mixing are added.
  • Additional keyword arguments can now be provided to the System constructor taking in an AtomsBase system.

Bug fixes

  • A bug when initialising forces in LangevinSplitting is fixed.
  • A bug when converting from an AtomsBase system without velocities is fixed.
  • A bug when setting up a system with infinite boundaries from a file is fixed.

v0.22.1

20 Mar 15:38

Choose a tag to compare

New features

  • Writing out trajectory files in formats supported by Chemfiles.jl, including DCD and XTC, is added via the TrajectoryWriter logger.
  • MolecularTopology can now optionally contain a list of indices of bonded atom pairs.
  • The weight_special option is added to Mie.
  • Functions required to calculate gradients for MorseBond are added.

Performance improvements

  • Simulation with ASECalculator is made faster.

Bug fixes

  • A memory issue when simulating with ASECalculator is fixed.
  • A bug in nested multithreading for DistanceNeighborFinder and TreeNeighborFinder is fixed.

v0.22.0

06 Feb 16:25

Choose a tag to compare

The package is rewritten to use Enzyme.jl rather than Zygote.jl for differentiable simulations. This allows mutating code to be used, leading to better performance on CPU and GPU. In addition, faster CUDA kernels are added and support for other GPU backends is added via KernelAbstractions.jl.

Breaking changes

  • CoordinateLogger, VelocityLogger and ForceLogger are renamed to CoordinatesLogger, VelocitiesLogger and ForcesLogger respectively for consistency.
  • During system setup the gpu keyword argument is replaced by array_type, with CuArray giving the same behaviour as before. Use of other array types such as ROCArray is supported. The use_cell_list keyword argument is replaced with neighbor_finder_type, with the default depending on the backend.
  • The second type parameter to System is changed from a Bool indicating whether the system is on the GPU to the array type of the system.
  • Giving the force_units and energy_units is no longer required when constructing pairwise interactions such as LennardJones. In addition, mixing functions and shortcut functions can now be given to determine how to combine atomic parameters and when to skip the interaction respectively.
  • The arguments to force and potential_energy for pairwise and specific interactions are changed to allow more flexible interaction definitions, depending for example on the velocities or step number.
  • Differentiable simulations are no longer compatible with Zygote.jl, but can now be carried out using Enzyme.jl. This is faster and more memory-efficient.
  • The solute field to Atom is removed and the atom_type field is added. weight_solute_solvent is no longer an option for LennardJones, though similar functionality is available with atom_type and mixing functions.
  • box_volume is renamed to volume.
  • run_loggers! is renamed to apply_loggers! to avoid confusion with the run_loggers function argument.
  • The abstract types PairwiseInteraction and SpecificInteraction are removed. Custom interactions no longer need to sub-type anything.
  • Extensions are added for code requiring Enzyme.jl, CUDA.jl and KernelDensity.jl, so relevant imports are now required before using those features.

Non-breaking changes

  • Support for Julia versions before 1.10 is dropped.

New features

  • Backends supported by KernelAbstractions.jl can be used to run simulations by using the appropriate array type or the array_type keyword argument during system setup.
  • The Berendsen pressure coupling method is added as BerendsenBarostat.
  • The density and dipole_moment functions are added.
  • The AshbaughHatch and Yukawa potentials are added.
  • VolumeLogger and DensityLogger are added.
  • The rng keyword argument is added to place_atoms, place_diatomics and random_coord, allowing reproducible coordinate generation.
  • The array_type function is added, giving the array type of a system or array.
  • The step number can be given as a third argument with a default of 0 to forces, potential_energy and virial acting on a system. This allows time-dependent forces, with the caveat that the step number resets to 1 every time simulate! is called and can also be 0 to calculate forces before the first step.
  • A method is added to random_velocities! which takes in and modifies the velocities as the first argument.

Performance improvements

  • Better CUDA force and potential energy kernels significantly improve performance on CUDA compatible devices. The GPUNeighborFinder is added for this path but does not calculate neighbors, which are calculated each step in the kernels.
  • Simulations are faster on both CPU and GPU due to mutating code leading to fewer memory allocations.
  • System setup from a file is made much faster.
  • The package is faster to load as a number of dependencies have been removed.
  • The performance of implicit solvent on CPU is improved.

Bug fixes

  • A bug when using more than two interactions on the GPU is fixed.
  • A type conversion bug in CellListMapNeighborFinder construction is fixed.

v0.21.2

17 Oct 13:47

Choose a tag to compare

Non-breaking changes

  • Updates are made for AtomsBase.jl 0.4. AtomsBase is no longer re-exported.

v0.21.1

08 Jul 15:21

Choose a tag to compare

Non-breaking changes

  • Compatibility bounds are updated for various packages.

Bug fixes

  • A bug in boundary gradient calculation is fixed.

v0.21.0

30 Apr 13:25

Choose a tag to compare

Breaking changes

  • Observable functions for GeneralObservableLogger now need to accept arbitrary keyword arguments, for example by adding kwargs... to the function call. This allows the logging changes described below.

Non-breaking changes

  • Support for Julia versions before 1.9 is dropped. A package extension, rather than Requires.jl, is used to provide visualize when GLMakie.jl is imported.

New features

  • ASECalculator is added, allowing Python ASE calculators to be used in Molly. The code is in a package extension available when PythonCall.jl is imported. It is the user's responsibility to have the required Python packages installed. Examples of using MACE and psi4 are given.
  • current_forces and current_potential_energy can be used in logging functions to reuse properties calculated in the simulation step. They default to nothing when the properties are not available.
  • Interaction types are allowed to be different for each replica in a ReplicaSystem.

Performance improvements

  • PotentialEnergyLogger, TotalEnergyLogger and ForceLogger avoid recomputation when the relevant properties are calculated in the simulation step.

Bug fixes

  • MollyCalculator now works in two dimensions and for other floating point types.