Brownian dynamics integrators with coordinate transforms to constant diffusion, implemented in Julia.
This codebase was developed for the paper "Numerical Methods with Coordinate Transforms for Efficient Brownian Dynamics Simulations", which can be found here.
Numerical integrators of Stochastic Differential Equations (SDEs) work well for constant (additive) noise but often lose performance, or fail to converge, for variable (multiplicative) noise. One solution, if and when it is possible, is to apply reversible transforms in space or time to convert a variable noise process into a constant noise process, which can be more efficiently sampled with traditional SDE integrators. Then, trajectories can be reweighted and the statistical and dynamical properties of the original process can be reconstructed.
Brownian dynamics is one of the most important classes of SDE process, with applications across the physical, biological, and data-driven sciences. This codebase provides a Julia toolbox for running high-efficiency simulations of Brownian dynamics processes with coordinate transforms.
To install this project, follow these steps:
- Clone the repository.
git clone https://github.com/dominicp6/Transforms-For-Brownian-Dynamics
-
Navigate to the project directory.
-
Install the required Julia packages:
The code has only been tested with the version numbers provided. If you are experiencing package syntax errors, consider downgrading the packages to the specified versions:
- "QuadGK" => v"2.8.2"
- "Statistics" => v"1.9.0"
- "JSON" => v"0.21.4"
- "HDF5" => v"0.16.15"
- "StatsBase" => v"0.34.0"
- "Plots" => v"1.38.17"
- "HCubature" => v"1.5.1"
- "FHist" => v"0.10.2"
Done!
The example_scripts folder contains prepared experiment scripts to get you started. The easiest way to start is to run these files in Julia and edit and extend them as per your requirements. Here's what a few of these scripts do:
example_scripts/1D_experiment.jlfor running Brownian dynamics simulations with or without transformations in one-dimensionexample_scripts/2D_experiment.jlfor running Brownian dynamics simulations with or without transformations in two-dimensionsexample_scripts/computational_efficiency_experiments.jlfor comparing the computational efficiency (minimum compute time required to reach a target error in the invariant measure) of various integrator/transform combinationsexample_scripts/finite_time_experiment.jlfor computing the finite time error in the evolving distribution for various integrator/transform combinations
The main functions for running experiments can be found in experiment_utils. Unless you want to extend the functionality of this package, it is unlikely that you will need to modify anything in this folder.
You can add your own custom integrators in general_utils/integrators.jl, your own custom diffusion tensors in general_utils\diffusion_tensors.jl, and your own potential functions in general_utils\potentials.jl. We recommend that you keep the other files in this folder unchanged.
By default, outputs of the experiment runs are stored in the outputs folder. If you want to re-run an experiment with the same name, remember to delete the old experiment folder first or this will cause problems when saving results.
We welcome contributions! If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push your changes to your fork.
- Submit a pull request to the main repository.
What follows is an introduction. See the paper for all technical details.
Brownian dynamics is defined through an Ito stochastic differential equation (SDE), which in one dimension reads
where
In higher dimensions,
where
We assume that
for reasonably well-behaved functions
Consider multivariate Brownian dynamics with
where
with an effective potential
Phase-space averages with respect to the invariant measure,
In the above, the map
Consider multivariate Brownian dynamics with
where
with an effective potential
Phase-space averages with respect to the invariant measure,
Note: The Lamperti and time-rescaling transforms can also be combined, see the paper for details.
This code repository implements one-dimensional and multidimensional time-rescalings as well as one-dimensional Lamperti transforms. Multi-dimensional Lamperti transforms have not been implemented yet. We welcome contributions to extend the functionality of the codebase!