1#ifndef DFTU_LCAO_POTS_H
2#define DFTU_LCAO_POTS_H
27void cal_pot_onsite(
const std::vector<double>& occ,
const int m_size,
const double u_value,
28 double* pot_onsite,
double& eu);
42 std::vector<TR>& pot_onsite)
44 pot_onsite.resize(pot_onsite_tmp.size());
45 for (
int i = 0; i < static_cast<int>(pot_onsite_tmp.size()); i++)
47 pot_onsite[i] =
static_cast<TR
>(pot_onsite_tmp[i]);
53 std::vector<std::complex<double>>& pot_onsite)
55 const int m_size = int(sqrt(pot_onsite_tmp.size()) / 2);
56 const int m_size2 = m_size * m_size;
57 pot_onsite.resize(pot_onsite_tmp.size());
58 for (
int m1 = 0; m1 < m_size; m1++)
60 for (
int m2 = 0; m2 < m_size; m2++)
63 index[0] = m1 * m_size + m2;
64 index[1] = m1 * m_size + m2 + m_size2;
65 index[2] = m2 * m_size + m1 + m_size2 * 2;
66 index[3] = m2 * m_size + m1 + m_size2 * 3;
67 pot_onsite[index[0]] = 0.5 * (pot_onsite_tmp[index[0]] + pot_onsite_tmp[index[3]]);
68 pot_onsite[index[3]] = 0.5 * (pot_onsite_tmp[index[0]] - pot_onsite_tmp[index[3]]);
69 pot_onsite[index[1]] = 0.5 * (pot_onsite_tmp[index[1]] - std::complex<double>(0.0, 1.0) * pot_onsite_tmp[index[2]]);
70 pot_onsite[index[2]] = 0.5 * (pot_onsite_tmp[index[1]] + std::complex<double>(0.0, 1.0) * pot_onsite_tmp[index[2]]);
98 const bool new_occ_mat);
118 const bool new_occ_mat,
126 const bool new_occ_mat,
132 const bool new_occ_mat,
133 std::complex<double>* pot_onsite);
168 std::complex<double>* pot_uterm,
169 const std::complex<double>* sk);
Definition parallel_orbitals.h:16
Definition dftu_base.h:21
Provide the basic information about unitcell.
Definition unitcell.h:16
#define T
Definition exp.cpp:237
Definition dftu_nao_adj.cpp:14
template void cal_pot_onsite< double >(const Plus_U_Base &dftu, const UnitCell &ucell, const Parallel_Orbitals *pv, const int spin, const bool new_occ_mat, double *pot_onsite)
void cal_pot_uterm(Plus_U_Base &dftu, const UnitCell &ucell, const Parallel_Orbitals *pv, const int spin, T *pot_uterm, const T *sk)
Compute the LCAO-basis U-term effective potential matrix.
Definition dftu_nao_pots.cpp:138
void transfer_pot_onsite(const std::vector< double > &pot_onsite_tmp, std::vector< TR > &pot_onsite)
transfer pot_onsite format from Pauli matrix storage to the target matrix-element type used by the Ha...
Definition dftu_nao_pots.h:41
double get_onsite_pot(const Plus_U_Base &dftu, const int T, const int iat, const int L, const int spin, const int m0, const int m1, const bool new_occ_mat)
one-body effective onsite potential element for a given (m0,m1) pair.
Definition dftu_nao_pots.cpp:205
void cal_pot_onsite(const std::vector< double > &occ, const int m_size, const double u_value, double *pot_onsite, double &eu)
On-site potential and Hubbard energy for one correlated shell: pot_onsite(m,m') = U_eff * (0....
Definition dftu_nao_pots.cpp:16
template void cal_pot_uterm< double >(Plus_U_Base &dftu, const UnitCell &ucell, const Parallel_Orbitals *pv, const int spin, double *pot_uterm, const double *sk)
Plus_U_Base dftu
Definition test_dftu_nao_op.cpp:11