pyscf.md package

Submodules

pyscf.md.distributions module

pyscf.md.distributions.MaxwellBoltzmannVelocity(mol, T=298.15, rng=Generator(PCG64) at 0x7FAF52E319A0)[source]

Computes velocities for a molecular structure using a Maxwell-Boltzmann distribution. Args:

mol : gto.mol object

Tfloat

Temperature, in Kelvin, that the distribution represents.

rngnp.random.Generator

Random number generator to sample from. Must contain a method normal. Default is to use the md.rng which is a np.random.Generator

Returns:

Velocities as a ndarray of dimension (natm, 3) in atomic units.

pyscf.md.integrators module

class pyscf.md.integrators.Frame(ekin=None, epot=None, coord=None, veloc=None, time=None)[source]

Bases: object

Basic class to hold information at each time step of a MD simulation

Attributes:
ekinfloat

Kinetic energy

epotfloat

Potential energy (electronic energy)

etotfloat

Total energy, sum of the potential and kinetic energy

coord2D array with shape (natm, 3)

Geometry of the system at the current time step

veloc2D array with shape (natm, 3)

Velocities of the system at the current time step

timefloat

Time for which this frame represents

class pyscf.md.integrators.NVTBerendson(method, T, taut, **kwargs)[source]

Bases: _Integrator

Berendsen (constant N, V, T) molecular dynamics

Args:

method : lib.GradScanner or rhf.GradientsMixin instance, or has nuc_grad_method method.

Method by which to compute the energy gradients and energies in order to propagate the equations of motion. Realistically, it can be any callable object such that it returns the energy and potential energy gradient when given a mol.

Tfloat

Target temperature for the NVT Ensemble. Given in K.

tautfloat

Time constant for Berendsen temperature coupling. Given in atomic units.

Attributes:
accelndarray

Current acceleration for the simulation. Values are given in atomic units (Bohr/a.u.^2). Dimensions is (natm, 3) such as

[[x1, y1, z1], [x2, y2, z2], [x3, y3, z3]]

class pyscf.md.integrators.VelocityVerlet(method, **kwargs)[source]

Bases: _Integrator

Velocity Verlet algorithm

Args:

method : lib.GradScanner or rhf.GradientsBase instance, or has nuc_grad_method method.

Method by which to compute the energy gradients and energies in order to propagate the equations of motion. Realistically, it can be any callable object such that it returns the energy and potential energy gradient when given a mol.

Attributes:
accelndarray

Current acceleration for the simulation. Values are given in atomic units (Bohr/a.u.^2). Dimensions is (natm, 3) such as

[[x1, y1, z1], [x2, y2, z2], [x3, y3, z3]]

pyscf.md.integrators.kernel(integrator, verbose=3)[source]

Module contents

Molecular Dynamics

Simple usage:

>>> from pyscf import gto, dft
>>> import pyscf.md as md
>>> mol = gto.M(atom='N 0 0 0; N 0 0 1', basis='def2-tzvp')
>>> mf = dft.RKS(mol)
>>> mf.xc = 'pbe,pbe'
>>> integrator = md.NVE(mf, dt=5, time=10).run()
pyscf.md.set_seed(seed)[source]

Sets the seed for the random number generator used by the md module