NPTLangevinAnisotropicState

class torch_sim.integrators.npt.NPTLangevinAnisotropicState(*, positions, masses, cell, pbc, atomic_numbers, system_idx=None, _constraints=<factory>, _system_extras=<factory>, _atom_extras=<factory>, _rng=None, momenta, energy, forces, stress, alpha, cell_alpha, b_tau, reference_cell, cell_positions, cell_velocities, cell_masses)[source]

Bases: NPTState

State for NPT Langevin dynamics with independent per-dimension cell lengths.

Each spatial dimension has its own logarithmic strain coordinate εi = ln(Li/Li0), driven by the corresponding diagonal pressure component P_ii. This is analogous to LAMMPS fix press/langevin with couple none.

With three identical target pressures the sum of forces equals the isotropic strain force, so the isotropic limit is recovered.

Variables:
  • positions (torch.Tensor) – Particle positions [n_particles, n_dim]

  • velocities (torch.Tensor) – Particle velocities [n_particles, n_dim]

  • energy (torch.Tensor) – Energy of the system [n_systems]

  • forces (torch.Tensor) – Forces on particles [n_particles, n_dim]

  • masses (torch.Tensor) – Particle masses [n_particles]

  • cell (torch.Tensor) – Simulation cell matrix [n_systems, n_dim, n_dim]

  • pbc (bool) – Whether to use periodic boundary conditions

  • system_idx (torch.Tensor) – System indices [n_particles]

  • atomic_numbers (torch.Tensor) – Atomic numbers [n_particles]

  • stress (torch.Tensor) – Stress tensor [n_systems, n_dim, n_dim]

  • reference_cell (torch.Tensor) – Original cell [n_systems, d, d]

  • cell_positions (torch.Tensor) – Per-dimension strain εi [n_systems, 3]

  • cell_velocities (torch.Tensor) – dεi/dt [n_systems, 3]

  • cell_masses (torch.Tensor) – Mass for strain DOFs [n_systems]

  • alpha (torch.Tensor) – Particle friction [n_systems]

  • cell_alpha (torch.Tensor) – Cell friction [n_systems]

  • b_tau (torch.Tensor) – Barostat time constant [n_systems]

Parameters:
Properties:
momenta (torch.Tensor): Particle momenta calculated as velocities*masses

with shape [n_particles, n_dimensions]

current_cell (torch.Tensor): Cell reconstructed from strain and reference_cell volume (torch.Tensor): Current volume from cell determinant n_systems (int): Number of independent systems in the batch device (torch.device): Device on which tensors are stored dtype (torch.dtype): Data type of tensors

property current_cell: Tensor

] = exp(εi) · ref[i,:].

Type:

Compute cell from per-dimension strain

Type:

cell[i,

property volume: Tensor

Current volume from cell determinant.