API

Pure-Python implementation

pymbd.mbd_energy(coords, alpha_0, C6, R_vdw, beta, lattice=None, k_grid=None, nfreq=15)[source]

Calculate an MBD energy.

Parameters
  • coords (array-like) – (a.u.) atom coordinates in rows

  • alpha_0 (array-like) – (a.u.) atomic polarizabilities

  • C6 (array-like) – (a.u.) atomic \(C_6\) coefficients

  • R_vdw (array-like) – (a.u.) atomic vdW radii

  • beta (float) – MBD damping parameter \(\beta\)

  • lattice (array-like) – (a.u.) lattice vectors in rows

  • k_grid (array-like) – number of \(k\)-points along reciprocal axes

  • nfreq (int) – number of grid points for frequency quadrature

pymbd.mbd_energy_species(coords, species, volume_ratios, beta, **kwargs)[source]

Calculate an MBD energy from atom types and Hirshfed-volume ratios.

Parameters
  • coords (array-like) – (a.u.) atom coordinates in rows

  • species (array-like) – atom types (elements)

  • volume_ratios (array-like) – ratios of Hirshfeld volumes in molecule and vacuum

  • beta (float) – MBD damping parameter \(\beta\)

  • kwargs – see mbd_energy()

pymbd.screening(coords, alpha_0, C6, R_vdw, beta, lattice=None, nfreq=15)[source]

Screen atomic polarizabilities.

Parameters
  • coords (array-like) – (a.u.) atom coordinates in rows

  • alpha_0 (array-like) – (a.u.) atomic polarizabilities

  • C6 (array-like) – (a.u.) atomic \(C_6\) coefficients

  • R_vdw (array-like) – (a.u.) atomic vdW radii

  • beta (float) – MBD damping parameter \(\beta\)

  • lattice (array-like) – (a.u.) lattice vectors in rows

  • nfreq (int) – number of grid points for frequency quadrature

Returns static polarizabilities, \(C_6\) coefficients, and \(R_\mathrm{vdw}\) coefficients (a.u.).

pymbd.pymbd.ang = 1.8897259885789233

(a.u.) angstrom

Can be imported directly as pymbd.ang.

Fortran bindings

class pymbd.fortran.MBDGeom(coords, lattice=None, k_grid=None, custom_k_pts=None, n_freq=None, do_rpa=False, get_spectrum=False, get_rpa_orders=False, rpa_rescale_eigs=False, max_atoms_per_block=None, ewald_cutoff_scaling=(1.0, 1.0))[source]

Represents an initialized libMBD geom_t object.

Parameters
  • coords (array-like) – (a.u.) atomic coordinates as rows

  • lattice (array-like) – (a.u.) lattice vectors as rows

  • k_grid (array-like) – number of \(k\)-points per reciprocal lattice vector

  • custom_k_pts (array-like) – (a.u.) custom \(k\)-points as rows

  • n_freq (int) – number of quadrature points for frequency integration

  • do_rpa (bool) – whether to calculate MBD energy via frequency integration

  • get_spectrum (bool) – whether to return eigenvalues and eigenvectors

  • get_rpa_orders (bool) – whether to return RPA order decomposition

  • rpa_rescale_eigs (bool) – whether to rescale RPA eigenvalues

property coords

(a.u.) Atom coordinates in rows.

has_lattice()[source]

Whether structure is a crystal.

property lattice

(a.u.) Lattice vectors in rows.

mbd_energy(alpha_0, C6, R_vdw=None, beta=0.0, a=6.0, sigma=None, damping='fermi, dip', variant='rsscs', force=False, intermediates=False)[source]

Calculate an MBD energy.

Parameters
  • alpha_0 (array-like) – (a.u.) atomic polarizabilities

  • C6 (array-like) – (a.u.) atomic \(C_6\) coefficients

  • R_vdw (array-like) – (a.u.) atomic vdW radii

  • sigma (array-like) – (a.u.) oscillator widths

  • beta (float) – MBD damping parameter \(\beta\)

  • a (float) – MBD damping parameter \(a\)

  • str (variant) – type of damping

  • str – one of ‘plain’, ‘scs’, ‘rsscs’

  • bool (force) – if True, calculate energy gradients

mbd_energy_species(species, volume_ratios, beta, **kwargs)[source]

Calculate an MBD energy from atom types and Hirshfed-volume ratios.

Parameters
  • species (array-like) – atom types (elements)

  • volume_ratios (array-like) – ratios of Hirshfeld volumes in molecule and vacuum

  • beta (float) – MBD damping parameter \(\beta\)

  • kwargs – see mbd_energy()

print_timing()[source]

Print timing from libMBD.

ts_energy(alpha_0, C6, R_vdw, sR, d=20.0, damping='fermi', force=False)[source]

Calculate a TS energy.

Parameters
  • alpha_0 (array-like) – (a.u.) atomic polarizabilities

  • C6 (array-like) – (a.u.) atomic \(C_6\) coefficients

  • R_vdw (array-like) – (a.u.) atomic vdW radii

  • sR (float) – TS damping parameter \(s_R\)

  • d (float) – TS damping parameter \(d\)

  • str (damping) – type of damping

  • bool (force) – if True, calculate energy gradients

ts_energy_species(species, volume_ratios, beta, **kwargs)[source]

Calculate a TS energy from atom types and Hirshfed-volume ratios.

Parameters
  • species (array-like) – atom types (elements)

  • volume_ratios (array-like) – ratios of Hirshfeld volumes in molecule and vacuum

  • sR (float) – TS damping parameter \(s_R\)

  • kwargs – see ts_energy()

pymbd.fortran.with_mpi

Whether libMBD was compiled with MPI

pymbd.fortran.with_scalapack

Whether libMBD was compiled with Scalapack