Skip to content

Issues with Triclinic c-rescale barostat tau_p #600

Description

@PascalSalzbrenner

The default triclinic c-rescale NPT integrator has a tendency to blow up (in particular) small cells. I think this may be because the default tau_p is several orders of magnitude too small, being set to 3*dt (torch_sim/integrators/npt.py:2940). The literature (and comment on the same line) seems to suggest it should be of the order of picoseconds. I think 3*dt may have been introduced accidentally? In addition, unlike the other barostats in the same file, it uses the or idiom instead of if tau_p is None, which raises RuntimeError: Boolean value of Tensor with more than one value is ambiguous if a per-system tensor is passed for tau_p.

Suggested solution: reintroduce 5000*dt for tau_p (or another sensible value, like 1000), and use if tau_p is None.

I thought I'd raise this as an issue because the right solution is a little bit a matter of taste, and there may be reasons beyond my understanding for the change in default, but would be happy to PR a fix if agreed. Repro script attached in case it is useful.

torchsim_crescale_tau_p_repro.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions