The module constructs a set of wavevector shells compatible with the reciprocal space of a periodic simulation box and a list of wavenumbers. The wavevectors are of the form

\vec k = (k_x, k_y, \dots) = \left(n_x \frac{2\pi}{L_x}, n_y
\frac{2\pi}{L_y}, \dots \right)

where n_x, n_y, \dots are integers and L_x, L_y, \dots denote the edge length of the cuboid box. A wavevector “shell” is defined by its wavenumber, i.e. the magnitude k=|\vec k|, including a tolerance. The number of wavevectors within each shell may be limited to avoid excessively large shells for large wavenumber.

The list of wavenumbers may be constructed using halmd.observables.utility.semilog_grid, where the smallest wavenumber is given by 2\pi / \max(L_x, L_y, \dots).


local numeric = halmd.numeric
local utility = halmd.observables.utility

local box = halmd.mdsim.box({length={5,10,20}})

local qmin = 2 * math.pi / numeric.max(box.length)
local grid = utility.semilog_grid({start=qmin, stop=5 * math.pi, decimation=10})
local wavevector = utility.wavevector({box = box, wavenumber = grid.value, tolerance=0.05, max_count=7})
class halmd.observables.utility.wavevector(args)

Construct instance of wavevector module.

  • args (table) – keyword arguments
  • args.box – instance of halmd.mdsim.box
  • args.wavenumber – list of wavenumbers
  • args.tolerance (number) – relative tolerance on wavevector magnitude
  • args.max_count (integer) – maximum number of wavevectors per wavenumber shell

Returns data slot that yiels the wavenumber grid.


Returns data slot that yiels the list of wavevectors grouped by their magnitude in ascending order.

Parameters:other – instance of halmd.observables.utility.wavevector

Implements the equality operator a = b and returns true if the other wavevector instance is the same as this one.

halmd.observables.utility.wavevector.add_options(parser, defaults)

Add module options to command line parser: wavenumbers, tolerance, max-count.