Skip to content

Add iso/aniso option for NPT_MTK#661

Open
harveydevereux wants to merge 7 commits intostfc:mainfrom
harveydevereux:mtk_aniso
Open

Add iso/aniso option for NPT_MTK#661
harveydevereux wants to merge 7 commits intostfc:mainfrom
harveydevereux:mtk_aniso

Conversation

@harveydevereux
Copy link
Collaborator

Closes #588

As far as I can tell the iso- and anisotropic ensembles are on the outside the same. So here I made it so NTP_MTK constructs based on the Ensemble type passed, which carries through.

if ensemble == "npt-mtk-iso":
    from ase.md.nose_hoover_chain import (
        IsotropicMTKNPT as ASE_NPT_MTK,  # noqa: N814 (camelcase-imported-as-constant)
    )
elif ensemble == "npt-mtk-aniso":
    from ase.md.nose_hoover_chain import (
        MTKNPT as ASE_NPT_MTK,  # noqa: N814 (camelcase-imported-as-constant)
    )
class IsotropicMTKNPT(MolecularDynamics):
    def __init__(
        self,
        atoms: Atoms,
        timestep: float,
        temperature_K: float,
        pressure_au: float,
        tdamp: float,
        pdamp: float,
        tchain: int = 3,
        pchain: int = 3,
        tloop: int = 1,
        ploop: int = 1,
        **kwargs,          # passed to MolecularDynamics
        
        
class MTKNPT(MolecularDynamics):
    def __init__(
        self,
        atoms: Atoms,
        timestep: float,
        temperature_K: float,
        pressure_au: float,
        tdamp: float,
        pdamp: float,
        tchain: int = 3,
        pchain: int = 3,
        tloop: int = 1,
        ploop: int = 1,
        **kwargs,          # passed to MolecularDynamics
    ):

@harveydevereux harveydevereux marked this pull request as ready for review February 6, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New/improved feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add anisotropic NPT with MTK equations?

3 participants