QMol_TDSE_abs_CAP - fmauger1/QMol-grid GitHub Wiki
QMol_TDSE_abs_CAP
Absorbing boundaries using a complex absorbing potential (CAP) at the edges of the discretization domain.
Description
Use QMol_TDSE_abs_CAP
to describe absorbing boundaries with a CAP. During the TDSE propagation, the CAP is added to the potential.
Class properties
Complex absorbing potential (CAP)
The QMol_TDSE_abs_CAP
class defines the following public get-access properties; each can be changed using the set
method:
amplitude (V0)
Amplitude of the CAP [ positive scalar (default 0.5) ]
- When constructing the CAP, the selected
shape
is multiplied by the specifiedamplitude
(including for user-defined shapes).
length (L)
Length of the absorbing region at the edges of the domain discretization [ positive scalar (default 10) | positive two-vector ]
- Scalar
length
defines a CAP with the same length on both sides of the discretization domain. length = [L_left, L_right]
independently specifies the CAP length on each side of the domain.- Note: The CAP is defined inward from the two ends of the Schrödinger-equation model discretization domain, one should therefore budget for this.
shape
Shape of the CAP [ 'sin^1/8' (default) | 'sin' | 'sin^2' | function handle ]
'sin^1/8'
uses a $\sin^{1/8}$ -shaped CAP.'sin'
uses a $\sin$ -shaped CAP.'sin^2'
uses a $\sin^2$ -shaped CAP.- A function handle enables user-defined CAPs, with the signature
@(x) fun(x)
, wherefun(0)=0
andfun(1)=V_max
, returns the values for the CAP at the beginning and end of the absorbing domain, respectively (the absorbing domain at the two ends of the discretization domain are linearly mapped to the segment[0 1]
when calling the CAP function).fun
must be real valued and positive; the sign and complex coefficients are properly assigned when the object isinitialize
d. We recommend settingV_max
to1
and using theamplitude
property to control the CAP height.
Other properties
These properties cannot be edited with the set
method.
isInitialized (isInit)
Whether the absorbing-boundary CAP object is properly initialized. This is used throughout the QMol-grid package to check that the absorber object holds meaningful information and is ready for use.
Class methods
Creation
constructor
Create an absorbing-boundary CAP object with empty class properties.
obj = QMol_TDSE_abs_CAP;
Create an absorbing-boundary CAP object with the name
properties set to the specified value
. Several name-value
pairs can be specified consecutively. Suitable name
is any of the CAP properties and is case insensitive.
obj = QMol_TDSE_abs_CAP(name1,value1);
obj = QMol_TDSE_abs_CAP(name1,value1,name2,value2,___);
Changing class properties
set
Update the name
properties of an absorbing-boundary CAP object to the specified value
. Several name-value
pairs can be specified consecutively. Suitable name
is any of the CAP 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 a false
value.
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 CAP 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.
Initializing the object
initialize
Initialize a QMol_TDSE_abs_CAP
object and set the isInitialized
flag to true
.
obj.initialize(SE,isForward);
SE
is the Schrödinger-equation-model handle object, i.e.,QMol_SE
, begin propagated in the TDSE simulation.isForward
specifies whether the TDSE propagation is forward (true
) or backward (false
) in time.- To avoid any mismatch in internal properties,
initialize
firstreset
the object before performing the initialization.
Run-time documentation
getMemoryProfile
Get an estimate of the memory held by a QMol_TDSE_abs_CAP
object with either
mem = obj.getMemoryProfile;
mem = obj.getMemoryProfile(false);
- The object must be properly
initialize
d. - The estimate only includes the discretization of the CAP on the domain grid and ignores other (small) properties.
- The output
mem
is the estimated size in bytes.
Additionally display the detail of the memory footprint with
mem = obj.getMemoryProfile(true);
showDocumentation
Display the run-time documentation for the specific configuration of a QMol_TDSE_abs_CAP
object.
ref = obj.showDocumentation;
- The output
ref
is a cell vector containing the list of references to be included in the bibliography.
Examples
Create a discretization domain and minimal Schrödinger-equation-model object.
disc = QMol_disc('xspan',-20:.1:25);
SE = QMol_SE('discretization',disc);
Create the CAP absorber and display the run-time documentation.
ABC = QMol_TDSE_abs_CAP('length',5);
ABC.initialize(SE,true);
ABC.showDocumentation;
yielding
* Absorbing boundaries complex absorbing potential
Length = 5 a.u. on both ends
Amplitude = 0.5 a.u. Shape = sin^1/8
V-01.21.000 (06/17/2024) F. Mauger
Display the estimated memory footprint for the object.
ABC.getMemoryProfile(true);
* Absorbing boundaries (mask) 7.0 KB
Test suite
Run the test suite for the class in normal or summary mode respectively with
QMol_test.test('TDSE_abs_CAP');
QMol_test.test('-summary','TDSE_abs_CAP');
For developers
Other hidden class properties
QMol_TDSE_abs_CAP
defines a handful of additional transient/constant and hidden properties to facilitate and speed up computations. These properties cannot be edited with the set
method, nor by any function outside of the object (SetAccess=private
attribute).
SE
Schrödinger-equation-model object [ [] (default) |
QMol_SE
handle object ]
- This is a copy of the Schrödinger-equation-model handle object passed to
initialize
. - Un-initialized
QMol_TDSE_abs_CAP
objects, i.e.,isInitialized == false
, have emptySE
. - For practical reasons,
SE
is editable byQMol_TDSE
classes.
V
Discretization of the CAP on the domain grid [ [] (default) | vector ]
- Un-initialized
QMol_TDSE_abs_CAP
objects, i.e.,isInitialized == false
, have emptyV
.
Notes
The results displayed in this documentation page were generated using version 01.21 of the QMol-grid package.
QMol_TDSE_abs_CAP
was introduced in version 01.20.