The LRTDDFT module¶
- class TransitionMatrix(matrix=None, norb_occ=None, norb_virt=None, log=None)[source]¶
Bases:
numpy.matrix
Matrix of Transition Quantities, might be either
CouplingMatrix
orTransitionMultipoles
- Parameters
matrix (matrix-like) – data of the coupling matrix. If present also the number of orbitals should be provided.
norb_occ (tuple) – number of occupied orbitals per spin channnel. Compulsory if
matrix
is specified.norb_virt (tuple) – number of empty orbitals per spin channnel. Compulsory if
matrix
is specified.log (Logfile) – Instance of the logfile from which the coupling matrix calculation is performed. Automatically retrieves the
norb_occ
and norb_virt` parameters. Whenlog
parameter is present the parametermatrix
is ignored.
- Raises
ValueError – if the file of the coupling matrix indicated by
log
does not exists
- class CouplingMatrix(matrix=None, norb_occ=None, norb_virt=None, log=None)[source]¶
Bases:
BigDFT.LRTDDFT.TransitionMatrix
Casida Coupling Matrix, extracted from the calculation performed by BigDFT
- diagonalize()[source]¶
Diagonalize the Coupling Matrix
- Returns
- tuple of the Eigenvvalues and Eigenvectors of the coupling matrix,
as returned by
numpy.linalg.eigh()
. We perform the transpose of the matrix with eigenvectors to have them sorted as row vectors
- Return type
(np.matrix, np.matrix)
- class Excitations(cm, tm)[source]¶
Bases:
object
LR Excited states of a system
Definition of the excited states in the Casida Formalism
- Parameters
cm (CouplingMatrix) – the matrix of coupling among transitions
tm (TransitionMultipoles) – scalar product of multipoles among transitions
- alpha_prime¶
elements of the integrand of the statical polarizability in the space of the excitations
- Type
array
- determine_occ_energies(evals)[source]¶
Extract the occupied energy levels from a Logfile BandArray structure, provided the tuple of the number of occupied states
- Parameters
evals (BandArray) – the eigenvalues as they are provided (for instance) from a Logfile class instance.
- dos(group='all', **kwargs)[source]¶
Density of States of the Excitations.
Provides an instance of the
DoS
class, corresponding to the Excitations instance.
- dos_dict(group='all')[source]¶
Dictionary for DoS creation.
Creates the keyword arguments that have to be passed to the meth:BigDFT.DoS.append method of the DoS class
- identify_singlet_and_triplets(tol=1e-05)[source]¶
- Find the lookup tables that select the singlets and the triplets among
the excitations
- Parameters
tol (float) – tolerance to be applied to recognise the spin character
- identify_thresholds(occ_energies, tol, nexc)[source]¶
Identify the thresholds per excitation.
For each of the first
nexc
excitations, identify the energy value of its corresponding threshold. This value is determined by projecting the excitation components on the occupied states and verifying that their norm for the highest energy level is below a given tolerance.
- lookup(group)[source]¶
Identify the group of the excitations according to the argument
- Parameters
group (str) –
A string chosen between
"all"
: provides the entire set of excitations (None
instead of the lookup array)"bt"
: provides only the excitations below threshold"at"
: provides only the excitations above threshold"singlets"
: provides the index of the excitations that have a singlet character"triplets"
: provides the index of the excitations that have a triplet character
- plot_Sminustwo(coord, alpha_ref=None, group='all')[source]¶
Inspect S-2 sum rule.
Provides an handle to the plotting of the $S^{-2}$ sum rule, which should provide reference values for the static polarizability tensor.
- Parameters
- Returns
reference to
matplotlib.pyplot
module.
- plot_alpha(**kwargs)[source]¶
Plot the imaginary part.
Plot the real or imaginary part of the dynamical polarizability.
- Keyword Arguments
- Returns
the reference to
matplotlib.pyplot
module.- Return type
matplotlib.pyplot
- plot_excitation_landscape(**kwargs)[source]¶
Represent the excitation landscape as splitted in the excitations class
- Parameters
**kwargs – keyword arguments to be passed to the pyplot instance. The
xlabel
,ylabel
as well asxlim
are already set.- Returns
- the reference to
matplotlib.pyplot
module.
- the reference to
- Return type
matplotlib.pyplot
Example
>>> ex=Excitations(cm,tm) >>> ex.split_excitations(evals=...,tol=1.e-4,nexc=...) >>> ex.plot_excitation_landscape(title='Excitation landscape')
- project_on_spin(exc, tol=1e-08)[source]¶
Control if an excitation has a Singlet or Triplet character
- spectrum_curves(omega, slice=None, weights=None)[source]¶
Calculate spectrum curves.
Provide the set of the curves associated to the weights. The resulting curves might then be used to draw the excitation spectra.
- Parameters
omega (array) – the linspace used for the plotting, of shape
(n,)
. Must be provided in Atomic Unitsslice (array) – the lookup array that has to be considered. if Not provided the entire range is assumed
weights (array) – the set of arrays used to weight the spectra. Must have shape
(rank,m)
, whererank
is equal to the number of eigenvalues. If m is absent it is assumed to be 1. When not specified, it defaults to the average oscillator strenghts.
- Returns
a set of spectrum curves, of shape equal to
(n,m)
, wheren
is the shape ofomega
andm
the size of the second dimension ofweights
.- Return type
array
- class TransitionDipoles(matrix=None, norb_occ=None, norb_virt=None, log=None)[source]¶
Bases:
BigDFT.LRTDDFT.TransitionMultipoles
Transition dipoles as provided in the version of the code < 1.8.0. Deprecated, to be used in some particular cases
- class TransitionMultipoles(matrix=None, norb_occ=None, norb_virt=None, log=None)[source]¶
Bases:
BigDFT.LRTDDFT.TransitionMatrix
Transition dipoles, extracted from the calculation performed by BigDFT
- get_transitions()[source]¶
Get the transition quantities as the dimensional objects which should contribute to the oscillator strengths.
- Returns
Transition quantities multiplied by the square root of the unperturbed transition energy
- Return type
numpy.array