lumeq.property package
Submodules
lumeq.property.chaos_rmt module
- spectral_form_factor(levels, times)[source]
Compute the spectral form factor from unfolded energy levels.
- Parameters:
levels (2d array (nsnap, nlevels)) – The unfolded energy levels to be analyzed.
times (array) – The time points at which to compute K(t) for Fourier transform.
- Returns:
The spectral form factor K(t) at the corresponding time points.
- Return type:
K (array)
Notes
The spectral form factor is
K(t) = <sum_{i,j} exp(-i (E_i - E_j) t)> / D^2. Equivalently,K(t) = <|sum_i exp(-i E_i t)|^2> / D^2.
- stat_wigner(s, itype='goe')[source]
Wigner-Dyson distribution for unfolded level spacing s.
P(s) = \frac{\pi}{2} s e^{-\frac{\pi}{4} s^2}for GOEP(s) = \frac{32}{\pi^2} s^2 e^{-\frac{4}{\pi} s^2}for GUE- Parameters:
s (array-like) – The unfolded level spacings to be evaluated.
itype (str, optional) – The type of random matrix ensemble. Can be ‘goe’ (Gaussian Orthogonal Ensemble), ‘gue’ (Gaussian Unitary Ensemble). Default is ‘goe’.
- Returns:
The probability density P(s) for the given unfolded level spacings.
- Return type:
P (array)
- unfold_level_spacing(levels, deg=5, center_window=False)[source]
Unfold the level spacing s = dN/dE * dE
- Parameters:
levels (array-like) – The energy levels to be unfolded.
deg (int, optional) – The degree of the polynomial fit to the staircase function N(E). Default is 5.
center_window (tuple, optional) – Fractional level window used for unfolding. For example,
(0.2, 0.8)uses levels between the 20th and 80th percentiles. Default is False, which uses all levels.
- Returns:
The unfolded energy levels. s (array): The unfolded level spacings.
- Return type:
eps (array)
- unfold_parameter(eps, param, ref=None)[source]
Rescale an external parameter using the variance of unfolded level velocities.
Figure 6 of Tao and Galitski, arXiv:2602.21299, uses
x = sqrt(C0) * (lambda - lambda0), whereC0 = <(d eps / d lambda)^2>.- Parameters:
eps (2d array (nparam, nlevels)) – Unfolded energy levels along the parameter grid.
param (1d array) – External parameter values, e.g. electric field or time.
ref (float, optional) – Reference parameter value
lambda0. Default isparam[0].
- Returns:
Unfolded parameter. c0 (float): Mean squared level velocity. vel (2d array): Level velocities
d eps / d lambda.- Return type:
x (1d array)
lumeq.property.energy_density_plot module
- class EnergyDensity(atom, functional, basis, ecp=None, charge=0, max_memory=4000, efield=None, debug=False)[source]
Bases:
objectground-state energy density: j_only(), jk(), xc() excited-state energy density: coulomb_only(), coulomb_exchange(), functional()
- decompose_energy_density(directory, nstates=1, estate=0, plotnum=3, grid_type=1, nxyz=0.1, dohirshfeld=True, dobecke=True, withcharge=False, decompose_es=True, cal_another_attraction=False)[source]
- decompose_energy_density_es(directory, hf_type, has_xc, ie, grid_type=1, dohirshfeld=True, dobecke=True)[source]
- energy_density_coulomb_exchange(dm1, dm2, dm3, dm4, rho_value1, rho_value2, hf_type)[source]
dm1, dm2: ground-state, difference, transition, transition_symmetric dm rho_value1, rho_value2: difference, transition rho_value
- energy_density_coulomb_only(dm1, dm2, rho_value1, rho_value2)[source]
dm1, dm2: ground-state, transition_symmetric dm rho_value1, rho_value2: difference, transition rho_value
lumeq.property.grids module
- class Grids(mf, nxyz=None)[source]
Bases:
object- ao_on_grids()[source]
Calculate the atomic orbital values and their derivatives on the grids.
- Returns:
Atomic-orbital values and their derivatives on the grids.
- Return type:
numpy.ndarray
- density_on_grids(dm, xctype='GGA')[source]
Calculate the electron density and its derivatives on the grids.
- Parameters:
dm (numpy.ndarray) – Density matrix.
xctype (str) – Exchange-correlation functional type, e.g.
'LDA'or'GGA'.
- Returns:
Electron density and its derivatives on the grids.
- Return type:
numpy.ndarray
- orbital_on_grids(mo_coeff)[source]
Calculate the molecular orbital values and their derivatives on the grids.
- Parameters:
mo_coeff (numpy.ndarray) – Molecular-orbital coefficients.
- Returns:
Molecular-orbital values and their derivatives on the grids.
- Return type:
numpy.ndarray
- plot_grid_values(values, title='density', filename='', nums=None)[source]
Plot the grid values in 3D space. Cubegen
- Parameters:
values (numpy.ndarray) – Grid values to plot.
title (str) – Plot title.
filename (str) – Cube-file prefix for saving the plot.
nums (int, optional) – Number of datasets to write when
valuescontains multiple grids.
lumeq.property.orbital_property module
lumeq.property.rdm_analysis module
- assemble_amplitudes(xy, nstates=None, rpa=False, itype='r')[source]
reshape the transition amplitudes from pyscf tdscf module
- Parameters:
xy –
tdscf.xytuples.nstates (int, optional) – Number of excited states.
rpa (bool, optional) – Whether to include the RPA
Yamplitudes.itype (str) – One of
'r','ro', or'u'.
- Returns:
Reshaped
(xs, ys)transition amplitudes.- Return type:
tuple
- cal_dipoles(dip_mat, rdm)[source]
calculate dipole moments from dipole integrals and 1-particle density matrices
- Parameters:
dip_mat (numpy.ndarray) – Dipole integrals in AO basis with shape
(3, nao, nao).rdm (numpy.ndarray) – One-particle density matrices with shape
(..., nao, nao).
- Returns:
Dipole moments with shape
(..., 3).- Return type:
numpy.ndarray
- cal_rdm1(xy1, coeff1, xy2=None, coeff2=None, scale=2.0, itype='trans')[source]
calculate 1-particle density matrices from xy amplitudes
- Parameters:
xy1 (list) – XY amplitudes for the first set of states.
coeff1 – Molecular orbitals for the first state set.
xy2 (list, optional) – XY amplitudes for the second set of states.
coeff2 (numpy.ndarray, optional) – Molecular orbitals for the second state set.
scale (float) –
2for restricted and1for unrestricted cases.itype (str) – Density-matrix type, e.g.
'trans'or'diff'.
- get_attach_dm(xy1, orbv1, xy2=None, orbv2=None, scale=2.0)[source]
calculate attach part of 1-particle density matrix from xy amplitudes bewteen excited states
- get_detach_dm(xy1, orbo1, xy2=None, orbo2=None, scale=2.0)[source]
calculate detach part of 1-particle density matrix from xy amplitudes bewteen excited states
- get_difference_dm(xy1, coeff1, xy2=None, coeff2=None, scale=2.0)[source]
calculate difference density matrix bewteen excited states
- Parameters:
xy1 (list) –
[xs, ys]amplitudes for the first state or geometry.xy2 (list, optional) –
[xs, ys]amplitudes for the second state or geometry.coeff1 (numpy.ndarray) – Molecular orbitals of the first state or geometry.
coeff2 (numpy.ndarray, optional) – Molecular orbitals of the second state, geometry, or spin channel.
- Returns:
Difference one-particle density matrix.
- Return type:
numpy.ndarray
- get_transition_dm(xy, coeff1, coeff2=None, scale=2.0)[source]
calculate transition 1-particle density matrix bewteen ground and excited states from xy amplitudes
- Parameters:
xy (list) –
[xs, ys]amplitudes, wherexsandysare arrays with shape(nstates, nocc, nvir).coeff1 (numpy.ndarray) – Ground-state molecular-orbital coefficients.
coeff2 (numpy.ndarray, optional) – Molecular-orbital coefficients for a different spin channel or geometry. Defaults to
coeff1.scale (float) –
2for restricted and1for unrestricted cases.
- Returns:
Transition one-particle density matrix.
- Return type:
numpy.ndarray
lumeq.property.sapt_dispersion module
lumeq.property.wf_overlap module
- cal_wf_overlap(Xm, Ym, Xn, Yn, Cm, Cn, S, itype='r')[source]
calculate wavefunction overlap between excited states at different nuclear configurations
- cal_wf_overlap_r(Xm, Ym, Xn, Yn, Cm, Cn, S)[source]
Calculate wavefunction overlap between excited states at different nuclear configurations for restricted case Ovlp = < Psi_m | Psi_n >
Matrix determinant lemma is used. vec1: S_vo S_oo^-1 in ov (transpose is used) vec2: S_oo^-1 S_ov in ov vec3: (S_vv - S_vo S_oo^-1 S_ov) in vv vec4: S_oo^-1 in oo
- Parameters:
Xm (numpy.ndarray) – Excitation amplitudes at geometry
mwith shape(nroots, nocc, nvir).Ym (numpy.ndarray) – De-excitation amplitudes with shape
(nroots, nocc, nvir).Xn (numpy.ndarray) – Excitation amplitudes at geometry
nwith shape(nroots, nocc, nvir).Yn (numpy.ndarray) – De-excitation amplitudes with shape
(nroots, nocc, nvir).Cm (numpy.ndarray) – Molecular-orbital coefficients at geometry
mwith shape(nbasis, nbasis).Cn (numpy.ndarray) – Molecular-orbital coefficients at geometry
nwith shape(nbasis, nbasis).S (numpy.ndarray) – Overlap matrix between geometries
mandnwith shape(nbasis, nbasis).
- Returns:
Wavefunction overlap matrix.
- Return type:
numpy.ndarray
- cal_wf_overlap_r0(Xm, Ym, Xn, Yn, Cm, Cn, S)[source]
slow version of wavefunction overlap of restricted case for checking
- cal_wf_overlap_sf(Xm, Ym, Xn, Yn, Cm, Cn, S, extype=0)[source]
calculate wavefunction overlap between excited states at different nuclear configurations for ro spin-flip case
- cal_wf_overlap_u(Xm, Ym, Xn, Yn, Cm, Cn, S)[source]
calculate wavefunction overlap between excited states at different nuclear configurations for unrestricted case