potentials module

class potentials.PotClass(dim, pot_id, stiff_eps)

Bases: object

This class implements several potential functions and their 1st-order derivatives.

Parameters

pot_id (int) – index of the potential function.

V(x)

This function computes the corresponding potential for given x, depending on the value of pot_id.

grad_V(x)

This function computes the gradient of the corresponding potential for given x, depending on the value of pot_id.

Returns

1st-order derivatives (gradients) at each point of the input.

grad_modified_dw1d(xvec, a=1.0, b=1.0, c=0.7)

1st-order derivative of the 1d double-well potential.

grad_v_1d_dw(x)

Compute the gradient of v_1d_dw().

grad_v_1d_quadratic(x)

1st-order derivative of the 1d quadratic potential.

grad_v_2d_3well(x)

Compute the gradient of potential v_2d_3well().

grad_v_2d_curved(x)

Compute the gradient of v_2d_curved().

grad_v_2d_dw_quadratic(x)

Compute the gradient of v_2d_dw_quadratic().

grad_v_2d_quaratic(x)

Compute the gradient of v_2d_quadratic().

grad_v_nd_3well_in_x01(x)

Compute the gradient of v_nd_3well_in_x01().

modified_dw1d(xvec, a=1.0, b=1.0, c=0.7)

1d double-well potential, defined as

\[\begin{split}f(x) = \begin{cases} \frac{b\pi^2}{4a^2} (x+a)^2 - cx \,, & x \in (-\infty, -a)\,; \\ \frac{b}{2}(\cos(\frac{x}{a}\pi) + 1.0)- cx\,, & x \in [-a,a)\,; \\ \frac{b\pi^2}{4a^2} (x-a)^2- cx \,, & x \in [a,+\infty)\,. \end{cases}\end{split}\]
Parameters
  • xvec (1d numpy array) – points for which to compute potential.

  • a,b,c (positive, double) – parameters used in defining \(f(x)\).

Returns

potential values at each point of xvec, same length as xvec.

Return type

1d numpy array.

output_potential(Param)
v_1d_dw(x)

1d double well potential. This function simply call modified_dw1d().

pot_id=2.

v_1d_quadratic(x)

1d quadratic potential \(f(x)=\frac{x^2}{2}.\)

pot_id=1.

v_2d_3well(x)

This is a 2d potential. It has three wells (low-potential regions) along radius.

pot_id=5.

v_2d_curved(x)

a 2d potential pot_id=6

v_2d_dw_quadratic(x)

2d potential, the sum of 1d double-well potential in \(x_1\) and 1d quadratic potential in \(x_2\).

pot_id=4.

v_2d_quadratic(x)

2d quadratic potential \(f(x) = 0.5 x_1^2 + 2.0 x_2^2\,, \mbox{for}~ x=(x_1,x_2) \in \mathbb{R}^2\,\).

pot_id=3.

v_nd_3well_in_x01(x)

This is a high-dimensional potential, a sum of v_2d_3well() in (x[0], x[1]) and quadratic in other dimensions.

pot_id=7.