Releases: JuliaMolSim/Molly.jl
Releases · JuliaMolSim/Molly.jl
v0.23.2
New features
- Support for virtual sites is added.
OneParticleSite,TwoParticleAverageSite,ThreeParticleAverageSiteandOutOfPlaneSiteare 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
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_resargument 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,CalcRgandCalcRMSD. 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
MonteCarloBarostatis fixed.
v0.23.0
Breaking changes
pressureandvirialnow 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 theEwaldandPMEmethods, but not constraints or implicit solvent methods. Custom general interactions can define a virial term if required. The scalar values can be calcuated withscalar_pressureandscalar_virial, with the corresponding loggersScalarPressureLoggerandScalarVirialLogger. The newforces_virialfunction allows calculation of both the forces and the virial at the same time, which can save computation. Thekinetic_energy_tensorfunction allows the kinetic energy of a system in its tensorial form to be calculated. Theneeds_virialfunction 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 thanAtomsCalculators.forcesand 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. LennardJonesSoftCoreandCoulombSoftCoreare removed and replaced withLennardJonesSoftCoreBeutler/LennardJonesSoftCoreGapsysandCoulombSoftCoreBeutler/CoulombSoftCoreGapsys, two popular soft core implementations.MonteCarloAnisotropicBarostatandMonteCarloMembraneBarostatare removed as their functionality is now available usingMonteCarloBarostatwith thecoupling_typekeyword argument.TrajectoryWriterandwrite_structurenow keep molecules connected over the periodic boundaries by default. Thecorrectionkeyword argument allows this to be controlled, with:wrapproviding the previous behaviour.StructureWriter, which wrote to the PDB format, is removed.TrajectoryWritershould be used to write to all file formats including PDB.RescaleThermostatis renamed toImmediateThermostatto better reflect what it does and to avoid confusion with the newVelocityRescaleThermostat.- The
implicit_solventkeyword argument when setting up a system from a file now takes symbols rather than strings, e.g.:gbn2instead of"gbn2", to increase consistency across the package. - The default
nonbonded_methodduring setup is now:none, i.e. short range interactions, compared to the reaction field approximation used before (now available with:cutoff). - The
dist_neighborskeyword argument during setup from a file is replaced withdist_buffer, a buffer distance added todist_cutoff. This means thatdist_cutoffcan be changed without having to also updatedist_buffer. - The arguments of
apply_loggers!andapply_couplers!are changed. AbstractGBSA,ResidueType,AtomType,PeriodicTorsionType,born_radii_and_grad,extract_parameters,inject_gradientsandmolecule_centersare no longer exported.- The type parameters of
CubicBoundary,RectangularBoundaryandTriclinicBoundaryare changed.
New features
- Ewald and particle mesh Ewald (PME) electrostatic summation methods are added as the
EwaldandPMEgeneral interactions respectively, which should be used alongside the correspondingCoulombEwaldpairwise interaction.PMEruns on all backends and is compatible with Enzyme when thegrad_safeoption is given during system setup from a file. Thenonbonded_methodkeyword argument during system setup from a file allows the electrostatic summation approach to be selected. Theewald_error_tolandapproximate_pmekeyword arguments are also added. - Constraints now work on the GPU and the documentation is improved. The
constraintsandrigid_waterkeyword arguments during system setup from a file allow different constraint options to be selected. Thecheck_constraintsfunction 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
BerendsenBarostatwith thecoupling_typekeyword argument. - The cutoff interface is now available for custom pairwise interactions with the use of
force_cutoffandpe_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
EnsembleSystemstruct andread_frame!function are added to help with loading trajectory data into aSystem. - The
DisplacementsLogger, useful for calculating properties such as mean squared displacements, is added. - The
replica_boundarieskeyword argument is added forReplicaSystem. - The
cutoffkeyword argument is added forGravity. - 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
TriclinicBoundarywith 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
TriclinicBoundarywith certain values are fixed. - A bug when using
CellListMapNeighborFinderin 2D is fixed.
v0.22.3
Bug fixes
- A bug when calculating the potential energy of a system using Measurements.jl is fixed.
v0.22.2
New features
write_structureis added to allow a system to be written to a file.TrajectoryWriternow writes out better PDB files.StructureWriteris now an alias forTrajectoryWriterwith the PDB format and will be removed in a future breaking release. It is recommended to replace instances ofStructureWriterwithTrajectoryWriter.- The
excluded_resandwrite_boundarykeyword arguments can now be given toTrajectoryWriter. Theatom_indskeyword argument can now be given toStructureWriter. AtomDatacan now storechain_idandhetero_atom, allowing better file writing.- The Urey-Bradley potential is added as
UreyBradley. - The mixing functions
waldman_hagler_σ_mixing,waldman_hagler_ϵ_mixingandfender_halsey_ϵ_mixingare added. - Additional keyword arguments can now be provided to the
Systemconstructor taking in an AtomsBase system.
Bug fixes
- A bug when initialising forces in
LangevinSplittingis 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
New features
- Writing out trajectory files in formats supported by Chemfiles.jl, including DCD and XTC, is added via the
TrajectoryWriterlogger. MolecularTopologycan now optionally contain a list of indices of bonded atom pairs.- The
weight_specialoption is added toMie. - Functions required to calculate gradients for
MorseBondare added.
Performance improvements
- Simulation with
ASECalculatoris made faster.
Bug fixes
- A memory issue when simulating with
ASECalculatoris fixed. - A bug in nested multithreading for
DistanceNeighborFinderandTreeNeighborFinderis fixed.
v0.22.0
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,VelocityLoggerandForceLoggerare renamed toCoordinatesLogger,VelocitiesLoggerandForcesLoggerrespectively for consistency.- During system setup the
gpukeyword argument is replaced byarray_type, withCuArraygiving the same behaviour as before. Use of other array types such asROCArrayis supported. Theuse_cell_listkeyword argument is replaced withneighbor_finder_type, with the default depending on the backend. - The second type parameter to
Systemis changed from aBoolindicating whether the system is on the GPU to the array type of the system. - Giving the
force_unitsandenergy_unitsis no longer required when constructing pairwise interactions such asLennardJones. 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
forceandpotential_energyfor 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
solutefield toAtomis removed and theatom_typefield is added.weight_solute_solventis no longer an option forLennardJones, though similar functionality is available withatom_typeand mixing functions. box_volumeis renamed tovolume.run_loggers!is renamed toapply_loggers!to avoid confusion with therun_loggersfunction argument.- The abstract types
PairwiseInteractionandSpecificInteractionare 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_typekeyword argument during system setup. - The Berendsen pressure coupling method is added as
BerendsenBarostat. - The
densityanddipole_momentfunctions are added. - The
AshbaughHatchandYukawapotentials are added. VolumeLoggerandDensityLoggerare added.- The
rngkeyword argument is added toplace_atoms,place_diatomicsandrandom_coord, allowing reproducible coordinate generation. - The
array_typefunction 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
0toforces,potential_energyandvirialacting on a system. This allows time-dependent forces, with the caveat that the step number resets to 1 every timesimulate!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
GPUNeighborFinderis 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
CellListMapNeighborFinderconstruction is fixed.
v0.21.2
Non-breaking changes
- Updates are made for AtomsBase.jl 0.4. AtomsBase is no longer re-exported.
v0.21.1
Non-breaking changes
- Compatibility bounds are updated for various packages.
Bug fixes
- A bug in boundary gradient calculation is fixed.
v0.21.0
Breaking changes
- Observable functions for
GeneralObservableLoggernow need to accept arbitrary keyword arguments, for example by addingkwargs...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
visualizewhen GLMakie.jl is imported.
New features
ASECalculatoris 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_forcesandcurrent_potential_energycan be used in logging functions to reuse properties calculated in the simulation step. They default tonothingwhen the properties are not available.- Interaction types are allowed to be different for each replica in a
ReplicaSystem.
Performance improvements
PotentialEnergyLogger,TotalEnergyLoggerandForceLoggeravoid recomputation when the relevant properties are calculated in the simulation step.
Bug fixes
MollyCalculatornow works in two dimensions and for other floating point types.