-
Notifications
You must be signed in to change notification settings - Fork 1
QMol_DFT_Vks_basis
Kohn-Sham-potential operator object
Use QMol_DFT_Vks_basis
to store the Kohn-Sham-potential operator for (TD)DFT simulations with a basis-set discretization. QMol_DFT_Vks_basis
is a handle class.
The QMol_DFT_Vks_basis
class defines the following public get-access properties; each can be changed using the set
method:
Discretization of the explicit part of the Kohn-Sham potential [ vector (default []) ]
- For spin restricted DFT model; irrelevant for spin restricted ones
- Properly allocated
potential
is anumel(
disc
.xspan)-by-1
vector matching the domain discretization of the associated (TD)DFT model
Discretization of the explicit part of the up-spin channel Kohn-Sham potential [ vector (default []) ]
- For spin polarized DFT model; irrelevant for spin restricted ones
- Properly allocated
potentialUp
is anumel(
disc
.xspan)-by-1
vector matching the domain discretization of the associated (TD)DFT model
Discretization of the explicit part of the down-spin channel Kohn-Sham potential [ vector (default []) ]
- For spin polarized DFT model; irrelevant for spin restricted ones
- Properly allocated
potentialDown
is anumel(
disc
.xspan)-by-1
vector matching the domain discretization of the associated (TD)DFT model
Implicit components of the Kohn-Sham potential [ cell of handle functions (default {}) ]
- For both spin restricted and polarized models, holds the implicit components of the Kohn-Sham potential. Implicit potential are defined through their action on orbitals instead of the value-at-grid-point their explicit counterparts.
- Each component of
potentialImplicit
contains a handle function describing one implicit-potential component. - For spin restricted models, the signature for implicit-potential components is
Hp = funV(p)
.p
andHp
are bothnumel(
disc
.xspan)-by-1
vectors respectively containing the discretization of the orbital to which the potential should be applied and its result. - For spin polarized models, the signature for implicit-potential components is
Hp = funV(p,isUp)
.p
andHp
are bothnumel(
disc
.xspan)-by-1
vectors respectively containing the discretization of the orbital to which the potential should be applied and its result. The second logical inputisUp
specifies whether applying the up- (true
) or down-spin (false
) potential operator to the input orbital.
Whether the Kohn-Sham potential is spin polarized (true
) or spin restricted (false
). isSpinPol
is used by other classes to determine whether they should use the potential
or potentialUp
and potentialDown
properties, and the proper interface for any potentialImplicit
component, in their calculations.
These properties cannot be edited with the set
method.
Whether the Kohn-Sham-potential operator object is properly initialized. This is used throughout the QMol-grid package to check that the potential object holds meaningful information and is ready for use. Changing its isSpinPol
may cause simulations to fail or produce erroneous results.
Flag indicating that QMol_DFT_Vks_basis
objects are discretization over a basis set [ false ]
- At run time,
isBasis
can be used to discriminateQMol_DFT_Vks
objects fromQMol_DFT_Vks_basis
(which overloads the class) - For class development purposes,
isBasis
is technically a static method. Practically, though, it can virtually almost always be treated as a constant property.
Create a Kohn-Sham-potential operator object with empty class properties.
obj = QMol_DFT_Vks;
Create a Kohn-Sham-potential operator object with the name
properties set to the specified value
. Several name-value
pairs can be specified consecutively. Suitable name
is any of the Kohn-Sham potential properties and is case insensitive.
obj = QMol_DFT_Vks(name1,value1);
obj = QMol_DFT_Vks(name1,value1,name2,value2,___);
Most often, Kohn-Sham-potential operator objects are created through domain-discretization or DFT objects.
obj = disc.DFT_allocatePotential;
obj = DFT.getPotential;
- Note: potential property assignation is provided for extended support. Most end users will not need these as editing the potential may cause simulations to produce erroneous results or fail altogether.
Update the name
properties of a Kohn-Sham potential object to the specified value
. Several name-value
pairs can be specified consecutively. Suitable name
is any of the Kohn-Sham potential 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
.
- Note: potential property assignation is provided for extended support. Most end users will not need these as editing the potential may cause simulations to produce erroneous results or fail altogether.
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 all class properties
obj.clear;
Clear a specific set of the class properties. Suitable name
is any of the Kohn-Sham potential 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_DFT_Vks
class.
Initialize a Kohn-Sham-potential operator object and sets the isInitialized
flag to true
.
obj.initialize(disc);
- To avoid any mismatch in internal properties,
initialize
firstreset
the object before performing the initialization. - The object must be initialized with its associated domain-discretization object
disc
(unlike for the grid-based discretizationQMol_DFT_Vks
for which it is optional, albeit recommended).
Get an estimate of the memory held by a QMol_DFT_Vks_basis
object with either
mem = obj.getMemoryProfile;
mem = obj.getMemoryProfile(false);
- The object must be properly
initialize
d with a domain discretization. - The estimate only includes the discretization of the explicit part of the Kohn-Sham potential 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);
For spin restricted DFT models, add an explicit potential component to a QMol_DFT_Vks_basis
object
obj.add(V);
- This performs the in-place addition
potential = potential + V
- The input
V
should be anumel(
disc
.xspan)-by-1
vector matching the domain discretization of the associated (TD)DFT model
For spin polarized DFT models, add the same explicit potential components to both the up- and down-spin components of a QMol_DFT_Vks_basis
object
obj.add(V);
- This performs the in-place additions
potentialUp = potentialUp + V
andpotentialDown = potentialDown + V
- The input
V
should be anumel(
disc
.xspan)-by-1
vector matching the domain discretization of the associated (TD)DFT model
For spin polarized DFT models, add different explicit potential components to the up- and down-spin components of a QMol_DFT_Vks_basis
object
obj.add(Vup,Vdown);
- This performs the in-place additions
potentialUp = potentialUp + Vup
andpotentialDown = potentialDown + Vdown
- The inputs
Vup
andVdown
should each benumel(
disc
.xspan)-by-1
vector matching the domain discretization of the associated (TD)DFT model - Replace any of
Vup
andVdown
by scalar0
to add an explicit potential component solely to the other spin channel.
For both spin restricted and polarized DFT models, add an implicit potential component to a QMol_DFT_Vks_basis
object
obj.add(funV);
-
funV
is a function handle describing the implicit-potential component (which is then added to thepotentialImplicit
list). - For spin resctricted models, the signature for the input function handle is
Hp = funV(p)
.p
andHp
are bothnumel(
disc
.xspan)-by-1
vectors respectively containing the discretization of the orbital to which the potential should be applied and its result. - For spin polarized models, the signature for the input function handle is
Hp = funV(p,isUp)
.p
andHp
are bothnumel(
disc
.xspan)-by-1
vectors respectively containing the discretization of the orbital to which the potential should be applied and its result. The second logical inputisUp
specifies whether applying the up- (true
) or down-spin (false
) potential operator to the input orbital.
For spin-restricted models, apply the potential operator to a wave function
Hp = obj.applyPotential(p);
- This computes the action of the entire -- including both explicit and implicit components -- Kohn-Sham potential operator on the input wave function
p
. All implicit components require the associated functional object to have their potential kernels properly set beforehand (withsetPotentialKernel
-- see the functional documentation).applyPotential
does not perform or check for this initialization. -
p
andHp
are both size(
disc
.basis,2)-by-1
vectors respectively containing the discretization of the orbital to which the potential should be applied and its result. -
applyPotential
requires the Kohn-Sham potential object to have been initialized
For spin-polarized models, apply the up- and down-spin Kohn-Sham potential operators to a wave function respectively with
Hp = obj.applyPotential(p,true);
Hp = obj.applyPotential(p,false);
- This computes the action of the entire -- including both explicit and implicit components -- Kohn-Sham potential operator on the input wave function
p
. All implicit components require the associated functional object to have their potential kernels properly set beforehand (withsetPotentialKernel
-- see the functional documentation).applyPotential
does not perform or check for this initialization. -
p
andHp
are both size(
disc
.basis,2)-by-1
vectors respectively containing the discretization of the orbital to which the potential should be applied and its result. -
applyPotential
requires the Kohn-Sham potential object to have been initialized
Most users will not use Kohn-Sham potential objects directly or will get them indirectly, through DFT and TDDFT simulations -- see their respective documentations for examples.
Run the test suite for the class in normal or summary mode respectively with
QMol_test.test('DFT_Vks_basis');
QMol_test.test('-summary','DFT_Vks_basis');
QMol_DFT_Vks_basis
implements a streamlined version of the clear
all method, since it might be called frequently in DFT and TDDFT computations. If adding properties to the class, the streamlined clear
all must be updated accordingly.
QMol_DFT_Vks_basis
overloads QMol_DFT_Vks
(and thus also QMol_suite
)
.
For internal use QMol_DFT_Vks_basis
defines additional transient properties. These cannot be edited with the set
method but can be directly edited by classes in the QMol-grig package.
Matrix representation of the explicit part of the Kohn-Sham potential [ square matrix (default []) ]
-
mV
is computed at the initialization of the object - It is defined as
mV(k,l) = sum(conj(disc.v(:,k)).*obj.V.*disc.v(:,l))*disc.dx
Matrix representation of the explicit part of the spin-up channel Kohn-Sham potential [ square matrix (default []) ]
-
mVup
is computed at the initialization of the object - It is defined as
mVup(k,l) = sum(conj(disc.v(:,k)).*obj.Vup.*disc.v(:,l))*disc.dx
Matrix representation of the explicit part of the spin-down channel Kohn-Sham potential [ square matrix (default []) ]
-
mVdw
is computed at the initialization of the object - It is defined as
mVdw(k,l) = sum(conj(disc.v(:,k)).*obj.Vdw.*disc.v(:,l))*disc.dx
-
QMol_DFT_Vks_basis
was introduced in version 01.00 - Version 01.10 integrated initialization with a domain discretization object
-
getMemoryProfile
was introduced in version 01.10
This wiki is a copy of the documentation provided with the QMol-grid package (accessible in MATLAB documentation, via the "Supplemental Software" section).
Copyright © 2024, Francois Mauger, all right reserved.
Density-functional theory (DFT)
QMol_DFT_density
QMol_DFT_eigs
QMol_DFT_eig_basis
QMol_DFT_orbital
QMol_DFT_orbital_basis
QMol_DFT_profiler
QMol_DFT_SCF_Anderson
QMol_DFT_spinPol
QMol_DFT_spinRes
QMol_DFT_Vc_LDA_soft
QMol_DFT_Vext
QMol_DFT_Vh_conv
QMol_DFT_Vh_fft
QMol_DFT_Vks
QMol_DFT_Vks_basis
QMol_DFT_Vks_grad
QMol_DFT_Vx_LDA_exp
QMol_DFT_Vx_LDA_soft
QMol_DFT_Vx_XX_conv
QMol_DFT_Vx_XX_fft
Tutorials
- Tutorial 1: Schrödinger-equation ground state
- Tutorial 2: Schrödinger-equation input and output
- Tutorial 3: Time-dependent Schrödinger equation
- Tutorial 4: Time-dependent Schrödinger-equation input and output
- Tutorial 5: Density-functional theory ground state
- Tutorial 6: Time-dependent density-functional theory
- Tutorial 7: Time-dependent density-functional theory input and output