maxwelllink.matter.md.force_fields package

Built-in classical force fields of the MaxwellLink MD engine

class maxwelllink.matter.md.force_fields.CH4COMPASSForceField[source]

Bases: DummyForceField

Flexible CH4 force field (ch4compass).

Implements the COMPASS class2 model of methane [H. Sun, J. Phys. Chem. B 102, 7338 (1998)].

Atoms are stored in the canonical order [C, H, H, H, H, C, H, H, H, H, ...].

__init__(n_molecules=100, positions=None, box=None, replicate=None, rcut=None, ewald_wrcut=None)[source]

Initialize the ch4compass force field and build the initial geometry.

Parameters:
  • n_molecules (int, default: 100) – Number of CH4 molecules. Ignored when positions is given. With the default value 100 and no positions/box, the bundled bulk-CH4 box (ch4_100.xyz, atomic units, the LAMMPS reference starting geometry) is loaded so that a fully default force field is production-ready.

  • positions (array-like of float, shape (5 * n_molecules, 3), optional) – Initial atomic positions in Bohr, ordered [C, H, H, H, H, ...]. If None a default geometry is built with a single equilibrium molecule for n_molecules == 1, otherwise a cubic lattice inside box.

  • box (float or array-like of float, shape (3,), optional) – Periodic box lengths in Bohr. None treats the system as a finite cluster.

  • replicate (int or array-like of int, shape (3,), optional) – Replicate the periodic cell. The molecules and the box lengths grow together, so the density is unchanged.

  • rcut (float, optional) – Real-space cutoff in Bohr for the periodic LJ and Coulomb sums. Defaults to 10 Angstrom (the LAMMPS pair cutoff), also clamped to half the shortest box side (17.35 Bohr in the bundled 100-CH4 box).

  • ewald_wrcut (float, optional) – Real-space cutoff in Bohr for the Ewald sum (also sets \(\alpha = \pi / \mathrm{wrcut}\) and kmax = int(alpha * max(box))). Defaults to rshort * min(0.5, 1.2 * n_atoms**(-1/6)).

build_force_kernels(xp, threads_per_block=128)[source]

Return this force field’s compiled kernels from kernels_ch4compass.

Parameters:
  • xp (module) – Array module: numpy for the CPU path, cupy for the GPU path.

  • threads_per_block (int, default: 128) – CUDA block size, ignored on the CPU path.

Returns:

The compiled force evaluator.

Return type:

kernels_ch4compass.CH4COMPASSForceKernels

compute(x, efield, terms=None)[source]

Evaluate the total ch4compass force and potential energy.

Parameters:
  • x (numpy.ndarray of float, shape (na, 3)) – Atomic positions in atomic units (Bohr).

  • efield (numpy.ndarray of float, shape (3,)) – Effective electric field [E_x, E_y, E_z] in atomic units.

  • terms (numpy.ndarray of float, shape (2,), optional) – Filled with the stretch and the bend energy when given.

Returns:

  • forces (numpy.ndarray of float, shape (na, 3)) – Total force on each atom in atomic units.

  • potential (float) – Mechanical potential energy in atomic units (Hartree).

compute_fast(x, efield, terms=None)

Evaluate the force and potential with the compiled (numba) kernels.

Physically identical to compute() but several times faster. The kernels and the output buffer are built once and reused.

Parameters:
  • x (numpy.ndarray of float, shape (na, 3)) – Atomic positions in atomic units (Bohr).

  • efield (numpy.ndarray of float, shape (3,)) – Effective electric field [E_x, E_y, E_z] in atomic units.

  • terms (numpy.ndarray of float, shape (len(reported_term_names),), optional) – Filled with the energy terms of reported_term_names when given.

Returns:

  • forces (numpy.ndarray of float, shape (na, 3)) – Total force on each atom in atomic units.

  • potential (float) – Mechanical potential energy in atomic units (Hartree).

dipole(x)[source]

Compute the molecular dipole moment from the atomic charges.

Parameters:

x (numpy.ndarray of float, shape (na, 3)) – Atomic positions in atomic units (Bohr).

Returns:

The total dipole \(\boldsymbol{\mu} = \sum_i q_i \mathbf{r}_i\) over the C and H charges, in atomic units.

Return type:

numpy.ndarray of float, shape (3,)

dipole_velocity(v)[source]

Compute the time derivative of the molecular dipole moment.

Parameters:

v (numpy.ndarray of float, shape (na, 3)) – Atomic velocities in atomic units.

Returns:

The dipole velocity \(\mathrm{d}\boldsymbol{\mu}/\mathrm{d}t = \sum_i q_i \mathbf{v}_i\) over the charges, in atomic units.

Return type:

numpy.ndarray of float, shape (3,)

has_compiled_kernels = True
molecule_symbols = ('C', 'H', 'H', 'H', 'H')
name = 'ch4compass'
reported_term_names = ('stretch_au', 'bend_au')
class maxwelllink.matter.md.force_fields.CO2JCP2021ForceField[source]

Bases: DummyForceField

Flexible CO2 force field (co2jcp2021).

Implements the anharmonic flexible-CO2 model of Li, Nitzan, and Subotnik [J. Chem. Phys. 154, 094124 (2021)], a quartic-Morse-stretch modification of the Cygan, Romanov, and Myshakin flexible-CO2 model [J. Phys. Chem. C 116, 13079 (2012)].

Atoms are stored in the canonical order [C, O, O, C, O, O, ...].

__init__(n_molecules=36, positions=None, box=None, replicate=None, rcut=None, ewald_wrcut=None)[source]

Initialize the co2jcp2021 force field and build the initial geometry.

Parameters:
  • n_molecules (int, default: 36) – Number of CO2 molecules. Ignored when positions is given. With the default value 36 and no positions/box, the bundled equilibrated bulk-CO2 box (co2_36.xyz, atomic units) is loaded so that a fully default force field is production-ready.

  • positions (array-like of float, shape (3 * n_molecules, 3), optional) – Initial atomic positions in Bohr, ordered [C, O, O, ...]. If None a default geometry is built with a single equilibrium molecule for n_molecules == 1, otherwise a cubic lattice inside box.

  • box (float or array-like of float, shape (3,), optional) – Periodic box lengths in Bohr. None treats the system as a finite cluster.

  • replicate (int or array-like of int, shape (3,), optional) – Replicate the periodic cell. The molecules and the box lengths grow together, so the density is unchanged.

  • rcut (float, optional) – Real-space cutoff in Bohr for the periodic LJ and Coulomb sums. Defaults to 18 Bohr (the LAMMPS pair cutoff), also clamped to half the shortest box side (12.6 Bohr in the bundled 36-CO2 box; a replicated cell lifts the clamp, so pass rcut=12.63 to keep a size ladder comparable with the unit cell).

  • ewald_wrcut (float, optional) – Real-space cutoff in Bohr for the Ewald sum (also sets \(\alpha = \pi / \mathrm{wrcut}\) and kmax = int(alpha * max(box))). Defaults to rshort * min(0.5, 1.2 * n_atoms**(-1/6)).

build_force_kernels(xp, threads_per_block=128)[source]

Return this force field’s compiled kernels from kernels_co2jcp2021.

Parameters:
  • xp (module) – Array module: numpy for the CPU path, cupy for the GPU path.

  • threads_per_block (int, default: 128) – CUDA block size, ignored on the CPU path.

Returns:

The compiled force evaluator.

Return type:

kernels_co2jcp2021.CO2JCP2021ForceKernels

compute(x, efield, terms=None)[source]

Evaluate the total co2jcp2021 force and potential energy.

Parameters:
  • x (numpy.ndarray of float, shape (na, 3)) – Atomic positions in atomic units (Bohr).

  • efield (numpy.ndarray of float, shape (3,)) – Effective electric field [E_x, E_y, E_z] in atomic units.

  • terms (numpy.ndarray of float, shape (2,), optional) – Filled with the stretch and the bend energy when given.

Returns:

  • forces (numpy.ndarray of float, shape (na, 3)) – Total force on each atom in atomic units.

  • potential (float) – Mechanical potential energy in atomic units (Hartree).

compute_fast(x, efield, terms=None)

Evaluate the force and potential with the compiled (numba) kernels.

Physically identical to compute() but several times faster. The kernels and the output buffer are built once and reused.

Parameters:
  • x (numpy.ndarray of float, shape (na, 3)) – Atomic positions in atomic units (Bohr).

  • efield (numpy.ndarray of float, shape (3,)) – Effective electric field [E_x, E_y, E_z] in atomic units.

  • terms (numpy.ndarray of float, shape (len(reported_term_names),), optional) – Filled with the energy terms of reported_term_names when given.

Returns:

  • forces (numpy.ndarray of float, shape (na, 3)) – Total force on each atom in atomic units.

  • potential (float) – Mechanical potential energy in atomic units (Hartree).

dipole(x)[source]

Compute the molecular dipole moment from the atomic charges.

Parameters:

x (numpy.ndarray of float, shape (na, 3)) – Atomic positions in atomic units (Bohr).

Returns:

The total dipole \(\boldsymbol{\mu} = \sum_i q_i \mathbf{r}_i\) over the C and O charges, in atomic units.

Return type:

numpy.ndarray of float, shape (3,)

dipole_velocity(v)[source]

Compute the time derivative of the molecular dipole moment.

Parameters:

v (numpy.ndarray of float, shape (na, 3)) – Atomic velocities in atomic units.

Returns:

The dipole velocity \(\mathrm{d}\boldsymbol{\mu}/\mathrm{d}t = \sum_i q_i \mathbf{v}_i\) over the charges, in atomic units.

Return type:

numpy.ndarray of float, shape (3,)

has_compiled_kernels = True
molecule_symbols = ('C', 'O', 'O')
name = 'co2jcp2021'
reported_term_names = ('stretch_au', 'bend_au')
class maxwelllink.matter.md.force_fields.CS2COMPASSForceField[source]

Bases: DummyForceField

Flexible CS2 force field (cs2compass).

Implements the COMPASS class2 model of carbon disulfide [H. Sun, J. Phys. Chem. B 102, 7338 (1998)].

Atoms are stored in the canonical order [C, S, S, C, S, S, ...].

__init__(n_molecules=36, positions=None, box=None, replicate=None, rcut=None, ewald_wrcut=None)[source]

Initialize the cs2compass force field and build the initial geometry.

Parameters:
  • n_molecules (int, default: 36) – Number of CS2 molecules. Ignored when positions is given. With the default value 36 and no positions/box, the bundled bulk-CS2 box (cs2_36.xyz, atomic units, the LAMMPS reference starting geometry) is loaded so that a fully default force field is production-ready.

  • positions (array-like of float, shape (3 * n_molecules, 3), optional) – Initial atomic positions in Bohr, ordered [C, S, S, ...]. If None a default geometry is built with a single equilibrium molecule for n_molecules == 1, otherwise a cubic lattice inside box.

  • box (float or array-like of float, shape (3,), optional) – Periodic box lengths in Bohr. None treats the system as a finite cluster.

  • replicate (int or array-like of int, shape (3,), optional) – Replicate the periodic cell. The molecules and the box lengths grow together, so the density is unchanged.

  • rcut (float, optional) – Real-space cutoff in Bohr for the periodic LJ and Coulomb sums. Defaults to 14 Bohr (the LAMMPS pair cutoff), also clamped to half the shortest box side (14.49 Bohr in the bundled 36-CS2 box).

  • ewald_wrcut (float, optional) – Real-space cutoff in Bohr for the Ewald sum (also sets \(\alpha = \pi / \mathrm{wrcut}\) and kmax = int(alpha * max(box))). Defaults to rshort * min(0.5, 1.2 * n_atoms**(-1/6)).

build_force_kernels(xp, threads_per_block=128)[source]

Return this force field’s compiled kernels from kernels_cs2compass.

Parameters:
  • xp (module) – Array module: numpy for the CPU path, cupy for the GPU path.

  • threads_per_block (int, default: 128) – CUDA block size, ignored on the CPU path.

Returns:

The compiled force evaluator.

Return type:

kernels_cs2compass.CS2COMPASSForceKernels

compute(x, efield, terms=None)[source]

Evaluate the total cs2compass force and potential energy.

Parameters:
  • x (numpy.ndarray of float, shape (na, 3)) – Atomic positions in atomic units (Bohr).

  • efield (numpy.ndarray of float, shape (3,)) – Effective electric field [E_x, E_y, E_z] in atomic units.

  • terms (numpy.ndarray of float, shape (2,), optional) – Filled with the stretch and the bend energy when given.

Returns:

  • forces (numpy.ndarray of float, shape (na, 3)) – Total force on each atom in atomic units.

  • potential (float) – Mechanical potential energy in atomic units (Hartree).

compute_fast(x, efield, terms=None)

Evaluate the force and potential with the compiled (numba) kernels.

Physically identical to compute() but several times faster. The kernels and the output buffer are built once and reused.

Parameters:
  • x (numpy.ndarray of float, shape (na, 3)) – Atomic positions in atomic units (Bohr).

  • efield (numpy.ndarray of float, shape (3,)) – Effective electric field [E_x, E_y, E_z] in atomic units.

  • terms (numpy.ndarray of float, shape (len(reported_term_names),), optional) – Filled with the energy terms of reported_term_names when given.

Returns:

  • forces (numpy.ndarray of float, shape (na, 3)) – Total force on each atom in atomic units.

  • potential (float) – Mechanical potential energy in atomic units (Hartree).

dipole(x)[source]

Compute the molecular dipole moment from the atomic charges.

Parameters:

x (numpy.ndarray of float, shape (na, 3)) – Atomic positions in atomic units (Bohr).

Returns:

The total dipole \(\boldsymbol{\mu} = \sum_i q_i \mathbf{r}_i\) over the C and S charges, in atomic units.

Return type:

numpy.ndarray of float, shape (3,)

dipole_velocity(v)[source]

Compute the time derivative of the molecular dipole moment.

Parameters:

v (numpy.ndarray of float, shape (na, 3)) – Atomic velocities in atomic units.

Returns:

The dipole velocity \(\mathrm{d}\boldsymbol{\mu}/\mathrm{d}t = \sum_i q_i \mathbf{v}_i\) over the charges, in atomic units.

Return type:

numpy.ndarray of float, shape (3,)

has_compiled_kernels = True
molecule_symbols = ('C', 'S', 'S')
name = 'cs2compass'
reported_term_names = ('stretch_au', 'bend_au')
class maxwelllink.matter.md.force_fields.DummyForceField[source]

Bases: object

Abstract base class for a classical molecular-dynamics (MD) force field.

__init__(n_molecules=1, positions=None, box=None, replicate=None, rcut=None, ewald_wrcut=None)[source]

Initialize the shared environment parameters of the force field.

Parameters:
  • n_molecules (int, optional) – Number of molecules in the system (before replication). This is used to determine the total number of atoms when the geometry is not provided. The default is 1.

  • positions (array-like of float, shape (na, 3), optional) – Atomic positions in atomic units (Bohr). If None a default geometry is built from n_molecules via _build_default_geometry().

  • box (float or array-like of float, shape (3,), optional) – Periodic box lengths in atomic units (Bohr). If None the system is a finite cluster and no periodic images are used.

  • replicate (int or array-like of int, shape (3,), optional) – Replicate the periodic cell. The molecules and the box lengths grow together, so the density is unchanged.

  • rcut (float, optional) – Real-space cutoff in Bohr for the non-bonded sums when a box is present.

  • ewald_wrcut (float, optional) – Real-space cutoff in Bohr for the Ewald sum (force fields with periodic electrostatics). None lets the subclass pick a default.

build_force_kernels(xp, threads_per_block=128)[source]

Return the compiled force evaluator of this force field.

Notes

This method should be overridden by subclasses that want the fast (numba) CPU path and the GPU batch backend. Without it only compute() is available.

Parameters:
  • xp (module) – Array module: numpy for the CPU path, cupy for the GPU path.

  • threads_per_block (int, default: 128) – CUDA block size, ignored on the CPU path.

Returns:

The force field’s compiled kernels.

Return type:

object

compute(x, efield, terms=None)[source]

Evaluate the total force and potential energy for a geometry and field.

The returned force must already include the external light-matter force \(q_i \mathbf{E}\) on each charge site (with any virtual-site forces redistributed onto the real atoms). The potential energy is the mechanical (field-free) one.

Notes

This method must be overridden by subclasses.

Parameters:
  • x (numpy.ndarray of float, shape (na, 3)) – Atomic positions in atomic units (Bohr).

  • efield (numpy.ndarray of float, shape (3,)) – Effective electric field [E_x, E_y, E_z] in atomic units.

  • terms (numpy.ndarray of float, shape (len(reported_term_names),), optional) – Filled with the energy terms of reported_term_names when given.

Returns:

  • forces (numpy.ndarray of float, shape (na, 3)) – Total force on each atom in atomic units.

  • potential (float) – Mechanical potential energy in atomic units (Hartree).

compute_fast(x, efield, terms=None)[source]

Evaluate the force and potential with the compiled (numba) kernels.

Physically identical to compute() but several times faster. The kernels and the output buffer are built once and reused.

Parameters:
  • x (numpy.ndarray of float, shape (na, 3)) – Atomic positions in atomic units (Bohr).

  • efield (numpy.ndarray of float, shape (3,)) – Effective electric field [E_x, E_y, E_z] in atomic units.

  • terms (numpy.ndarray of float, shape (len(reported_term_names),), optional) – Filled with the energy terms of reported_term_names when given.

Returns:

  • forces (numpy.ndarray of float, shape (na, 3)) – Total force on each atom in atomic units.

  • potential (float) – Mechanical potential energy in atomic units (Hartree).

dipole(x)[source]

Return the molecular dipole moment for a given geometry.

Notes

This method must be overridden by subclasses.

Parameters:

x (numpy.ndarray of float, shape (na, 3)) – Atomic positions in atomic units (Bohr).

Returns:

The dipole moment \(\boldsymbol{\mu} = \sum_i q_i \mathbf{r}_i\) in atomic units.

Return type:

numpy.ndarray of float, shape (3,)

dipole_velocity(v)[source]

Return the time derivative of the molecular dipole moment.

Notes

This method must be overridden by subclasses.

Parameters:

v (numpy.ndarray of float, shape (na, 3)) – Atomic velocities in atomic units.

Returns:

The dipole velocity \(\mathrm{d}\boldsymbol{\mu}/\mathrm{d}t = \sum_i q_i \mathbf{v}_i\) in atomic units.

Return type:

numpy.ndarray of float, shape (3,)

has_compiled_kernels = False
molecule_symbols = ()
name = 'dummy'
reported_term_names = ()
class maxwelllink.matter.md.force_fields.QTIP4PFForceField[source]

Bases: DummyForceField

q-TIP4P/F flexible-water force field.

Implements the q-TIP4P/F water model of Habershon, Markland, and Manolopoulos [J. Chem. Phys. 131, 024501 (2009)].

Atoms are stored in the canonical order [O, H, H, O, H, H, ...].

Notes

Electrostatics use a direct sum for an isolated molecule or cluster (box is None) and an Ewald sum for a periodic box. With no arguments the force field loads the bundled 32-molecule bulk-water box. Explicit n_molecules=216 selects the original 216-water box, and replicate tiles either box into a larger one at the same density. Equilibrate at the target temperature before production.

__init__(n_molecules=32, positions=None, box=None, replicate=None, rcut=None, ewald_wrcut=None)[source]

Initialize the q-TIP4P/F force field and build the initial geometry.

Parameters:
  • n_molecules (int, default: 32) – Number of water molecules. Ignored when positions is given. With the default value 32 and no positions/box, load water_32.xyz (Bohr). Explicit 216 loads the original water_216.xyz box.

  • positions (array-like of float, shape (3 * n_molecules, 3), optional) – Initial atomic positions in Bohr, ordered [O, H, H, ...]. If None a default geometry is built with a single equilibrium molecule for n_molecules == 1, otherwise a cubic lattice inside box.

  • box (float or array-like of float, shape (3,), optional) – Periodic box lengths in Bohr. None treats the system as a finite cluster.

  • replicate (int or array-like of int, shape (3,), optional) – Replicate the periodic cell. The molecules and the box lengths grow together, so the density is unchanged.

  • rcut (float, optional) – Real-space cutoff in Bohr for the periodic LJ and Coulomb sums. Defaults to 9 Angstrom, clamped to half the shortest box side (9.3 Bohr in the bundled 32-water box; a replicated cell lifts the clamp, so pass rcut=9.315 to keep a size ladder comparable with the unit cell).

  • ewald_wrcut (float, optional) – Real-space cutoff in Bohr for the Ewald sum (also sets \(\alpha = \pi / \mathrm{wrcut}\) and kmax = int(alpha * max(box))). Defaults to rshort * min(0.5, 1.2 * n_atoms**(-1/6)).

build_force_kernels(xp, threads_per_block=128)[source]

Return this force field’s compiled kernels from kernels_qtip4pf.

Parameters:
  • xp (module) – Array module: numpy for the CPU path, cupy for the GPU path.

  • threads_per_block (int, default: 128) – CUDA block size, ignored on the CPU path.

Returns:

The compiled force evaluator.

Return type:

kernels_qtip4pf.QTIP4PFForceKernels

compute(x, efield, terms=None)[source]

Evaluate the total q-TIP4P/F force and potential energy.

The force combines the intramolecular stretch/bend, the oxygen-oxygen Lennard-Jones term, the intermolecular Coulomb term, and the external light-matter force \(q_i \mathbf{E}\) on each charge site; the virtual M-site force is redistributed onto O, H, H by the chain rule.

Parameters:
  • x (numpy.ndarray of float, shape (na, 3)) – Atomic positions in atomic units (Bohr).

  • efield (numpy.ndarray of float, shape (3,)) – Effective electric field [E_x, E_y, E_z] in atomic units.

  • terms (numpy.ndarray of float, shape (2,), optional) – Filled with the stretch and the bend energy when given.

Returns:

  • forces (numpy.ndarray of float, shape (na, 3)) – Total force on each atom in atomic units.

  • potential (float) – Mechanical potential energy in atomic units (Hartree).

compute_fast(x, efield, terms=None)

Evaluate the force and potential with the compiled (numba) kernels.

Physically identical to compute() but several times faster. The kernels and the output buffer are built once and reused.

Parameters:
  • x (numpy.ndarray of float, shape (na, 3)) – Atomic positions in atomic units (Bohr).

  • efield (numpy.ndarray of float, shape (3,)) – Effective electric field [E_x, E_y, E_z] in atomic units.

  • terms (numpy.ndarray of float, shape (len(reported_term_names),), optional) – Filled with the energy terms of reported_term_names when given.

Returns:

  • forces (numpy.ndarray of float, shape (na, 3)) – Total force on each atom in atomic units.

  • potential (float) – Mechanical potential energy in atomic units (Hartree).

dipole(x)[source]

Compute the molecular dipole moment from the charge-site positions.

Parameters:

x (numpy.ndarray of float, shape (na, 3)) – Atomic positions in atomic units (Bohr).

Returns:

The total dipole \(\boldsymbol{\mu} = \sum_i q_i \mathbf{r}_i\) over the M-site and hydrogen charges, in atomic units.

Return type:

numpy.ndarray of float, shape (3,)

dipole_velocity(v)[source]

Compute the time derivative of the molecular dipole moment.

Parameters:

v (numpy.ndarray of float, shape (na, 3)) – Atomic velocities in atomic units.

Returns:

The dipole velocity \(\mathrm{d}\boldsymbol{\mu}/\mathrm{d}t = \sum_i q_i \mathbf{v}_i\) over the charge sites, in atomic units.

Return type:

numpy.ndarray of float, shape (3,)

has_compiled_kernels = True
molecule_symbols = ('O', 'H', 'H')
name = 'qtip4pf'
reported_term_names = ('stretch_au', 'bend_au')
maxwelllink.matter.md.force_fields.available_force_fields()[source]

Return the registered force-field names.

maxwelllink.matter.md.force_fields.replicate_cell(positions, box, replicate)[source]

Tile a periodic cell nx * ny * nz times.

Parameters:
  • positions (array-like of float, shape (..., na, 3)) – Atomic positions in atomic units (Bohr); leading axes (e.g. XYZ frames) are kept.

  • box (float or array-like of float, shape (3,)) – Periodic box lengths in atomic units (Bohr) of the cell being tiled.

  • replicate (int or array-like of int, shape (3,)) – Three integers are the images along x, y and z. One integer is the total number of images, laid out as a cube when it is a cubic number (27 -> 3 x 3 x 3), as a square in the xy plane when it is a square number (4 -> 2 x 2 x 1), and in a row along x otherwise (6 -> 6 x 1 x 1).

Returns:

  • positions (numpy.ndarray of float, shape (…, na * nx * ny * nz, 3)) – The tiled positions; every image keeps the per-molecule atom order.

  • box (numpy.ndarray of float, shape (3,)) – The enlarged box lengths.

  • counts (numpy.ndarray of int, shape (3,)) – The image counts (nx, ny, nz) that were applied.

Raises:

ValueError – If replicate is not one or three positive integers.

Submodules