QMol_Va_Gaussian - fmauger1/QMol-grid GitHub Wiki

QMol_Va_Gaussian

Gaussian-shape pseudopotential

Description

Use QMol_Va_Gaussian to describe an atomic center with a Gaussian-shaped pseudopotential parameterized as

$$ V(x)=-V _0 \ \exp \left(-\frac{(x-x _0 )^2 }{2\sigma^2 }\right) .~~~~~~(1) $$

QMol_Va_Gaussian is a handle class.

Class properties

Potential parameters

The QMol_Va_Gaussian class defines the following public get-access properties; each can be changed using the set method:

atom (name)

Name of the atomic pseudopotential [ string (default []) ]

  • This name is displayed in the run-time documentation.

potentialDepth (V0)

Depth, $V_0$ in Eq. (1), of the Gaussian pseudopotential [ scalar (default 1) ]

potentialWidth (s)

Width, $\sigma$ in Eq. (1), of the Gaussian pseudopotential [ scalar (default 2) ]

position (X0)

Center position, $x_0$ in Eq. (1), of the Gaussian pseudopotential [ scalar (default 0) ]

mass (m)

Atomic mass of the center [ scalar (default []) ]

  • This is used for simulations that include nuclear dynamics

momentum (p)

Canonical momentum of the atomic center [ scalar (default []) ]

  • This is used for simulations that include nuclear dynamics

Other properties

These properties cannot be edited with the set method.

isInitialized (isInit)

Whether the pseudopotential object is properly initialized. This is used throughout the QMol-grid package to check that the pseudopotential object holds meaningful information and is ready for use. Changing its isSpinPol may cause simulations to fail or produce erroneous results.

Class methods

Creation

constructor

Create a Gaussian-shape pseudopotential object with default class properties.

obj = QMol_Va_Gaussian;

Create a Gaussian-shape pseudopotential object with the name properties set to the specified value. Several name-value pairs can be specified consecutively. Suitable name is any of the potential parameters properties and is case insensitive.

obj = QMol_Va_Gaussian(name1,value1);
obj = QMol_Va_Gaussian(name1,value1,name2,value2,___);

Changing class properties

set

Update the name properties of a Gaussian-shape pseudopotential object to the specified value. Several name-value pairs can be specified consecutively. Suitable name is any of the potential parameters properties and is case insensitive.

obj.set(name1,value1);
obj.set(name1,value1,name2,value2,___);

This is the common name-value pair assignment method used throughout the QMol-grid package. The set method also reset the class. After running, the set property updates the isInitialized flag to false.

reset

Reset the object by deleting/re-initializing all run-time properties of the class and updating the isInitialized flag to false.

obj.reset;

This is the common reset method available to all classes throughout the QMol-grid package.

clear

Clear all class properties

obj.clear;

Clear a specific set of the class properties. Suitable name is any of the potential parameters properties and is case insensitive.

obj.clear(name1,name2,___);

This is the common clear method available to all classes throughout the QMol-grid package. The clear method also reset the class. The clear method can be used to delete specific properties before saving an instance of the QMol_Va_Gaussian class.

Initializing the object

initialize

Initialize the Gaussian-shape pseudopotential object and set the isInitialized flag to true with any of

obj.initialize;
obj.initialize([]);
obj.initialize(QM);
  • Initialization with an empty or QMol-grid theory object QM is provided for consistency across the QMol-grid package but is ignored during the initialization.

Potential discretization

getPotential

Get the discretization of the pseudopotential

V = obj.getPotential(x);
  • The input x can be a scalar, vector, or array of any size and shape. The output V matches the shape of x with the element-wise solution of the pseudopotential Eq. (1).

getPotentialDerivative

Get the discretization of the spatial derivative (gradient) of the pseudopotential

DV = obj.getPotentialDerivative(1,x);
  • The input x can be a scalar, vector, or array of any size and shape. The output DV matches the shape of x with the element-wise derivative of the pseudopotential of Eq. (1).
  • Note that the first input 1 is required. This is to provide a uniform signature with higher dimension where the dimension along which the gradient component is applied must be specified

Run-time documentation

showDocumentation

Display the full run-time documentation with either

ref = obj.showDocumentation;
ref = obj.showDocumentation('full');
  • The output ref is a cell vector containing the list of cited bibliographic references (for compatibility with other run-time documentation features in the QMol-grid package).

Display only a generic description of the pseudopotential

ref = obj.showDocumentation('potential');
  • The output ref is a cell vector containing the list of cited bibliographic references (for compatibility with other run-time documentation features in the QMol-grid package).
  • This does not display the specific potential parameters held in the QMol_Va_Gaussian object

Display only the summary of the potential parameters held in the QMol_Va_Gaussian object

ref = obj.showDocumentation('parameters');
  • The output ref = 'Gaussian' is a unique ID for the Gaussian-shape pseudopotentials. It is used for compact run-time documentation of molecular potentials.
  • This does not display the generic description of the pseudopotential, just the values for the parameters.

Examples

Define the discretization domain

x = -20:.1:25;

Create a Gaussian-shape pseudopotential and display its run-time documentation

V = QMol_Va_Gaussian('atom','X','potentialDepth',3,'potentialWidth',5,'position',3);
V.initialize;
V.showDocumentation;

yielding

  * Atomic center                                     (Gaussian potential)
    Parameterized as V(x) = -V0 * exp( -(x-X0).^2 / (2*s^2) ), with
    name     = X
    V0       = 3.00  
    s        = 5.00  
    X0       = 3.00  
    V-01.21.000 (06/17/2024)                                     F. Mauger

Plot the Gaussian-shape pseudopotential and its gradient

figure; hold on
plot(x,V.getPotential(x),'-','LineWidth',2,'DisplayName','V')
plot(x,V.getPotentialDerivative(1,x),'-','LineWidth',2','DisplayName','{\nabla}V')
xlabel('position (a.u.)'); xlim(x([1 end]));
ylabel('potential/gradient')
legend show

Test suite

Run the test suite for the class in normal or summary mode respectively with

QMol_test.test('Va_Gaussian');
QMol_test.test('-summary','Va_Gaussian');

Notes

The results displayed in this documentation page were generated using version 01.21 of the QMol-grid package.

  • QMol_Va_Gaussian was introduced in version 01.00.
  • Version 01.10 changed the name of the class from QMol_Va_exp