wavefunction_analysis.polariton package

Submodules

wavefunction_analysis.polariton.condensate module

bose_einstein_distribution(energy, chemical_potential=0.0, temperature=300, unit='eh')[source]

wavefunction_analysis.polariton.greens_func module

absorption_spectra(x, coupling, dos)[source]

assume same coupling

density_of_states_e(g0, gc, coupling)[source]

density of states of the polariton states # sigma[0] and sigma[1] are the real and imaginary parts, respectively # omega is the photon energy # eta is a small phenomenological parameter

density_of_states_p(x, sigma, omega, width=0.0001)[source]

density of states of the polariton states # sigma[0] and sigma[1] are the real and imaginary parts, respectively # omega is the photon energy # eta is a small phenomenological parameter

greens_func_e(g0, gc, coupling, itype='both')[source]

Greens function of exciton states

greens_func_e0_gauss(x, center, width=0.0001, scaling=1.0, itype='both', appro=False)[source]

Greens function of the unperturbed exciton states disordered state energy spectrum has Gaussian distribution

greens_func_e0_lorentz(x, center, width=0.0001, scaling=1.0, itype='both')[source]

Greens function of the unperturbed exciton states disordered state energy spectrum has Lorentzian distribution # width is a small phenomenological parameter

greens_func_p(x, sigma, omega, width=0.0001, itype='both')[source]

Greens function of the polariton states # sigma[0] and sigma[1] are the real and imaginary parts, respectively # omega is the photon energy # eta is a small phenomenological parameter

plot_sigma(ax, x, coupling, omega0, omegac, width, method, axis_label)[source]

sigma represents the self-energy

self_energy_same_coupling(x, coupling, center, width=0.0001, method='gauss-0', itype='both')[source]

this function assumes: 1. same coupling strengths for all the states whose disorder is given by width 2. disordered state energy spectrum following Gaussian or Lorentzian distribution

wavefunction_analysis.polariton.qed_ks module

get_dse_2e(dipole, dm, with_j=False, scale_k=0.5)[source]
get_dse_2e_xyz(dipole, dm, with_j=False, scale_k=0.5)[source]
get_dse_elec_nuc(dipole, nuc_dip)[source]
get_energy_nuc_dip(nuc_dip)[source]
get_lambda2(c_lambda)[source]
get_multipole_matrix(mol, itype='dipole', dipole=None, quadrupole=None, c_lambda=None, origin=None)[source]

c_lambda: (n_mode, 3) = coupling_strength * sqrt(2.*photon_frequency)

get_nuclear_dipoles(mol, c_lambda, origin=None)[source]

lambda cdot nuclear_dipole

get_scaled_lambda(c_lambda, frequency, photon_coeff=1.0)[source]

return frequency-scaled coupling strength (c_lambda)

class polariton(mol, xc='LDA,VWN')[source]

Bases: RKS

QED-RKS ground state, independent of photon frequency

get_multipole_matrix(c_lambda, dipole=None, quadrupole=None, origin=None, frequency=None, trans_coeff=None)[source]
nuc_grad_method()[source]

Hook to create object for analytical nuclear gradients.

class polariton_cs(mol, xc='LDA,VWN')[source]

Bases: polariton

in photon coherent states

Gradients(*args, **kwargs)

Non-relativistic restricted Hartree-Fock gradients

Hessian(*args, **kwargs)

Non-relativistic RKS hessian

energy_elec(dm=None, h1e=None, vhf=None)[source]

Electronic part of RKS energy.

Note this function has side effects which cause mf.scf_summary updated.

Parameters:
  • ks – an instance of DFT class

  • dm – 2D ndarray one-particle density matrix

  • h1e – 2D ndarray Core hamiltonian

Returns:

RKS electronic energy and the 2-electron contribution

gen_response(*args, **kwargs)[source]

Generate a function to compute the product of RHF response function and RHF density matrices.

Kwargs:
singlet (None or boolean)If singlet is None, response function for

orbital hessian or CPHF will be generated. If singlet is boolean, it is used in TDDFT response kernel.

get_coupling_energy(dm=None, unit='ev')[source]
get_hcore(mol=None)[source]
get_veff(mol=None, dm=None, *args, **kwargs)[source]

Coulomb + XC functional

Note

This function will modify the input ks object.

Parameters:
  • ks – an instance of RKS XC functional are controlled by ks.xc attribute. Attribute ks.grids might be initialized.

  • dm – ndarray or list of ndarrays A density matrix or a list of density matrices

Kwargs:
dm_lastndarray or a list of ndarrays or 0

The density matrix baseline. If not 0, this function computes the increment of HF potential w.r.t. the reference HF potential matrix.

vhf_lastndarray or a list of ndarrays or 0

The reference Vxc potential matrix.

hermiint

Whether J, K matrix is hermitian

0 : no hermitian or symmetric
1 : hermitian
2 : anti-hermitian
Returns:

matrix Veff = J + Vxc. Veff can be a list matrices, if the input dm is a list of density matrices.

class polariton_ns(mol, xc='LDA,VWN')[source]

Bases: polariton

in photon number states, not recommended!

Gradients(*args, **kwargs)

Non-relativistic restricted Hartree-Fock gradients

energy_elec(dm=None, h1e=None, vhf=None)[source]

Electronic part of RKS energy.

Note this function has side effects which cause mf.scf_summary updated.

Parameters:
  • ks – an instance of DFT class

  • dm – 2D ndarray one-particle density matrix

  • h1e – 2D ndarray Core hamiltonian

Returns:

RKS electronic energy and the 2-electron contribution

energy_nuc()[source]
get_coupling_energy(dm=None, unit='ev')[source]
get_hcore(mol=None)[source]
get_veff(mol=None, dm=None, *args, **kwargs)[source]

Coulomb + XC functional

Note

This function will modify the input ks object.

Parameters:
  • ks – an instance of RKS XC functional are controlled by ks.xc attribute. Attribute ks.grids might be initialized.

  • dm – ndarray or list of ndarrays A density matrix or a list of density matrices

Kwargs:
dm_lastndarray or a list of ndarrays or 0

The density matrix baseline. If not 0, this function computes the increment of HF potential w.r.t. the reference HF potential matrix.

vhf_lastndarray or a list of ndarrays or 0

The reference Vxc potential matrix.

hermiint

Whether J, K matrix is hermitian

0 : no hermitian or symmetric
1 : hermitian
2 : anti-hermitian
Returns:

matrix Veff = J + Vxc. Veff can be a list matrices, if the input dm is a list of density matrices.

print_qed_dse_energy(coupling, e0, e1, e_tot, unit='ev')[source]

wavefunction_analysis.polariton.qed_ks_grad module

class Gradients(mf)[source]

Bases: Gradients

dse_fock_d1(mol, dm, dipole_d1=None, quadrupole_d1=None)[source]
get_veff(mol=None, dm=None)[source]

First order derivative of DFT effective potential matrix (wrt electron coordinates)

Parameters:

ks_grad – grad.uhf.Gradients or grad.uks.Gradients object

class Gradients2(mf)[source]

Bases: Gradients

dse_fock_d1(mol, dm, dipole_d1=None, quadrupole_d1=None)[source]
grad_nuc(mol=None, atmlst=None)[source]
cal_multipole_matrix_d1(mol, dm=None, origin=None)[source]
cal_multipole_matrix_fd(mol, dm=None, origin=None, norder=2, step_size=0.0001, ideriv=1)[source]
finite_difference(mf, norder=2, step_size=0.0001, ideriv=2, extra=False)[source]
get_dse_2e(dipole, dipole_d1, dm, with_j=False, scale_k=0.5)[source]
get_dse_elec_nuc_d1(dipole_d1, nuc_dip)[source]
get_dse_elec_nuc_grad(dipole, nuc_dip_d1, dm)[source]
get_grad_nuc_dip(nuc_dip, nuc_dip_d1)[source]
get_multipole_matrix_d1(mol, c_lambda, origin=None, itype='all')[source]
get_nuclear_dipoles_d1(charges, c_lambda)[source]

wavefunction_analysis.polariton.qed_ks_hess module

class Hessian(mf)[source]

Bases: Hessian

make_h1(mo_coeff, mo_occ, chkfile=None, atmlst=None, verbose=None)
partial_hess_elec(mo_energy=None, mo_coeff=None, mo_occ=None, atmlst=None, max_memory=4000, verbose=None)
dse_fock_d1_s(dipole, dipole_d1, dm, with_j=False, scale_k=0.5)[source]
fd_orbital_rotation_mo1(mf, fd_mo)[source]
get_dse_2e_a(dipole, dipole_d2, dm, with_j=False, scale_k=0.5)[source]
get_multipole_matrix_d2(mol, c_lambda, origin=None)[source]

second-order analytic derivative of the multipole integrals are not implemented

make_h1(hessobj, mo_coeff, mo_occ, chkfile=None, atmlst=None, verbose=None)[source]
partial_hess_elec(hessobj, mo_energy=None, mo_coeff=None, mo_occ=None, atmlst=None, max_memory=4000, verbose=None)[source]
resemble_deriv_on_atoms(mol, mat0)[source]

wavefunction_analysis.polariton.qed_ks_response module

cphf_with_freq(mf, h1, mo_energy=None, mo_coeff=None, mo_occ=None, freq=0, level_shift=0.1, max_cycle=20, tol=1e-09, hermi=False, verbose=2)[source]
get_polarizability(mol, mf, h1=None, freq=0.0, scale=False, method=1)[source]

wavefunction_analysis.polariton.qed_thermo module

get_g1_d1(mf, frequency, hessobj)[source]
harmonic_analysis(mol, force_const_au, norm_mode, g1, frequency, imaginary_freq=True, mass=None)[source]
project_trans_rotation(mol, hess, exclude_trans=True, exclude_rot=True, mass=None)[source]

Each column is one mode

wavefunction_analysis.polariton.td_gks_soc module

class GHF(mol)[source]

Bases: GHF

gen_response(mo_coeff=None, mo_occ=None, with_j=True, hermi=0, max_memory=None)

Generate a function to compute the product of GHF response function and GHF density matrices. add soc components

get_ab(mf, mo_energy=None, mo_coeff=None, mo_occ=None)[source]
make_h01_soc1e(mol, orbo=None, orbv=None, so_eff_charge=False, qed_fac=1)[source]

Module contents