Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions docs/advanced/input_files/input-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
[berry_phase](#berry_phase) | [gdir](#gdir) | [towannier90](#towannier90) | [nnkpfile](#nnkpfile) | [wannier_spin](#wannier_spin)
- [TDDFT: time dependent density functional theory](#tddft-time-dependent-density-functional-theory) (Under tests)

[td_force_dt](#td_force_dt) | [td_vext](#td_vext) | [td_vext_dire](#td_vext_dire) | [td_stype](#td_stype) | [td_ttype](#td_ttype) | [td_tstart](#td_tstart) | [td_tend](#td_tend) | [td_lcut1](#td_lcut1) | [td_lcut2](#td_lcut2) | [td_gauss_freq](#td_gauss_freq) | [td_guass_phase](#td_gauss_phase) | [td_gauss_sigma](#td_gauss_sigma) | [td_gauss_t0](#td_gauss_t0)| [td_gauss_amp](#td_gauss_amp) | [td_trape_freq](#td_trape_freq) | [td_trape_phase](#td_trape_phase) | [td_trape_t1](#td_trape_t1) | [td_trape_t2](#td_trape_t2) | [td_trape_t3](#td_trape_t3) | [td_trape_amp](#td_trape_amp) | [td_trigo_freq1](#td_trigo_freq1) | [td_trigo_freq2](#td_trigo_freq2) | [td_trigo_phase1](#td_trigo_phase1) | [td_trigo_phase2](#td_trigo_phase2) | [td_trigo_amp](#td_trigo_amp) | [td_heavi_t0](#td_heavi_t0) | [td_heavi_amp](#td_heavi_amp) | [out_dipole](#out_dipole) |[out_efield](#out_efield)| [ocp](#ocp) | [ocp_set](#ocp_set) | [td_val_elec_01](#td_val_elec_01) | [td_val_elec_02](#td_val_elec_02) |[td_val_elec_03](#td_val_elec_03)
[td_force_dt](#td_force_dt) | [td_vext](#td_vext) | [td_vext_dire](#td_vext_dire) | [td_stype](#td_stype) | [td_ttype](#td_ttype) | [td_tstart](#td_tstart) | [td_tend](#td_tend) | [td_lcut1](#td_lcut1) | [td_lcut2](#td_lcut2) | [td_gauss_freq](#td_gauss_freq) | [td_guass_phase](#td_gauss_phase) | [td_gauss_sigma](#td_gauss_sigma) | [td_gauss_t0](#td_gauss_t0)| [td_gauss_amp](#td_gauss_amp) | [td_trape_freq](#td_trape_freq) | [td_trape_phase](#td_trape_phase) | [td_trape_t1](#td_trape_t1) | [td_trape_t2](#td_trape_t2) | [td_trape_t3](#td_trape_t3) | [td_trape_amp](#td_trape_amp) | [td_trigo_freq1](#td_trigo_freq1) | [td_trigo_freq2](#td_trigo_freq2) | [td_trigo_phase1](#td_trigo_phase1) | [td_trigo_phase2](#td_trigo_phase2) | [td_trigo_amp](#td_trigo_amp) | [td_heavi_t0](#td_heavi_t0) | [td_heavi_amp](#td_heavi_amp) | [out_dipole](#out_dipole) |[out_efield](#out_efield)| [ocp](#ocp) | [ocp_set](#ocp_set) |
- [DFT+*U* correction](#dftu-correction) (Under development)

[dft_plus_u](#dft_plus_u) | [orbital_corr](#orbital_corr) | [hubbard_u](#hubbard_u) | [yukawa_potential](#yukawa_potential) | [yukawa_lambda](#yukawa_lambda) | [omc](#omc)
Expand Down Expand Up @@ -2183,24 +2183,6 @@ These variables are used to control berry phase and wannier90 interface paramete
- **Description**: If ocp is true, the ocp_set is a string to set the number of occupancy, like 1 10 * 1 0 1 representing the 13 band occupancy, 12th band occupancy 0 and the rest 1, the code is parsing this string into an array through a regular expression.
- **Default**: none

### td_val_elec_01

- **Type**: Integer
- **Description**: Only useful when calculating the dipole. Specifies the number of valence electron associated with the first element.
- **Default**: 1.0

### td_val_elec_02

- **Type**: Integer
- **Description**: Only useful when calculating the dipole. Specifies the number of valence electron associated with the second element.
- **Default**: 1.0

### td_val_elec_03

- **Type**: Integer
- **Description**: Only useful when calculating the dipole. Specifies the number of valence electron associated with the third element.
- **Default**: 1.0

[back to top](#full-list-of-input-keywords)

## Variables useful for debugging
Expand Down
6 changes: 3 additions & 3 deletions source/module_elecstate/potentials/H_TDDFT_pw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
#include "module_base/constants.h"
#include "module_base/timer.h"
#include "module_hamilt_lcao/module_tddft/ELEC_evolve.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you add this line?

#include "module_io/input.h"
#include "module_io/input_conv.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"


namespace elecstate
{
Expand Down Expand Up @@ -48,7 +47,8 @@ void H_TDDFT_pw::cal_fixed_v(double *vl_pseudo)
std::stringstream as;
as << GlobalV::global_out_dir << "efield_" << count << ".dat";
std::ofstream ofs(as.str().c_str(), std::ofstream::app);
ofs << H_TDDFT_pw::istep * dt * ModuleBase::AU_to_FS << "\t" << vext_time << endl;
ofs << H_TDDFT_pw::istep * dt * ModuleBase::AU_to_FS << "\t"
<< vext_time * ModuleBase::Ry_to_eV / ModuleBase::BOHR_TO_A << endl;
ofs.close();
}

Expand Down
6 changes: 4 additions & 2 deletions source/module_esolver/esolver_ks_lcao_tddft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,10 @@ void ESolver_KS_LCAO_TDDFT::updatepot(const int istep, const int iter)
#endif
for (int ik = 0; ik < GlobalC::kv.nks; ++ik)
{
psi->fix_k(ik);
for (int index = 0; index < psi[0].size(); ++index)
this->psi->fix_k(ik);
this->psi_laststep->fix_k(ik);
int size0 = psi->get_nbands() * psi->get_nbasis();
for (int index = 0; index < size0; ++index)
psi_laststep[0].get_pointer()[index] = psi[0].get_pointer()[index];
}
if (istep > 1 && ELEC_evolve::td_edm == 0)
Expand Down
4 changes: 1 addition & 3 deletions source/module_hamilt_lcao/module_tddft/ELEC_evolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ ELEC_evolve::ELEC_evolve(){};
ELEC_evolve::~ELEC_evolve(){};

double ELEC_evolve::td_force_dt;
int ELEC_evolve::td_val_elec_01;
int ELEC_evolve::td_val_elec_02;
int ELEC_evolve::td_val_elec_03;
bool ELEC_evolve::td_vext;
std::vector<int> ELEC_evolve::td_vext_dire_case;
bool ELEC_evolve::out_dipole;
Expand All @@ -41,6 +38,7 @@ void ELEC_evolve::evolve_psi(const int& istep,
ModuleBase::timer::tick("Efficience", "evolve_k");
Evolve_LCAO_Matrix ELM(lowf.ParaV);
psi->fix_k(ik);
psi_laststep->fix_k(ik);
ELM.evolve_complex_matrix(ik, phm, psi, psi_laststep, &(ekb(ik, 0)));
ModuleBase::timer::tick("Efficience", "evolve_k");
} // end k
Expand Down
3 changes: 0 additions & 3 deletions source/module_hamilt_lcao/module_tddft/ELEC_evolve.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ class ELEC_evolve
// fuxiang add 2021-05-25

static double td_force_dt;
static int td_val_elec_01;
static int td_val_elec_02;
static int td_val_elec_03;
static bool td_vext;
static std::vector<int> td_vext_dire_case;
static bool out_dipole;
Expand Down
18 changes: 0 additions & 18 deletions source/module_io/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,6 @@ void Input::Default(void)
// tddft
//----------------------------------------------------------
td_force_dt = 0.02;
td_val_elec_01 = 1;
td_val_elec_02 = 1;
td_val_elec_03 = 1;
td_vext = false;
td_vext_dire = "1";

Expand Down Expand Up @@ -1483,18 +1480,6 @@ bool Input::Read(const std::string &fn)
{
read_value(ifs, td_force_dt);
}
else if (strcmp("td_val_elec_01", word) == 0)
{
read_value(ifs, td_val_elec_01);
}
else if (strcmp("td_val_elec_02", word) == 0)
{
read_value(ifs, td_val_elec_02);
}
else if (strcmp("td_val_elec_03", word) == 0)
{
read_value(ifs, td_val_elec_03);
}
else if (strcmp("td_vext", word) == 0)
{
read_value(ifs, td_vext);
Expand Down Expand Up @@ -2909,9 +2894,6 @@ void Input::Bcast()
Parallel_Common::bcast_int(vdw_cutoff_period.y);
Parallel_Common::bcast_int(vdw_cutoff_period.z);
// Fuxiang He add 2016-10-26
Parallel_Common::bcast_int(td_val_elec_01);
Parallel_Common::bcast_int(td_val_elec_02);
Parallel_Common::bcast_int(td_val_elec_03);
Parallel_Common::bcast_double(td_force_dt);
Parallel_Common::bcast_bool(td_vext);
Parallel_Common::bcast_string(td_vext_dire);
Expand Down
3 changes: 0 additions & 3 deletions source/module_io/input.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,6 @@ class Input
// Fuxiang He add 2016-10-26
//==========================================================
double td_force_dt; //"fs"
int td_val_elec_01; // valence electron 01
int td_val_elec_02; // valence electron 02
int td_val_elec_03; // valence electron 03
bool td_vext; // add extern potential or not
std::string td_vext_dire; // vext direction
bool out_dipole; // output the dipole or not
Expand Down
3 changes: 0 additions & 3 deletions source/module_io/input_conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,6 @@ void Input_Conv::Convert(void)
//----------------------------------------------------------
#ifdef __LCAO
ELEC_evolve::td_force_dt = INPUT.td_force_dt;
ELEC_evolve::td_val_elec_01 = INPUT.td_val_elec_01;
ELEC_evolve::td_val_elec_02 = INPUT.td_val_elec_02;
ELEC_evolve::td_val_elec_03 = INPUT.td_val_elec_03;
ELEC_evolve::td_vext = INPUT.td_vext;
if (ELEC_evolve::td_vext)
{
Expand Down
3 changes: 0 additions & 3 deletions source/module_io/test/INPUT
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,6 @@ exx_opt_orb_tolerence 0 #

#Parameters (16.tddft)
td_force_dt 0.02 #time of force change
td_val_elec_01 1 #td_val_elec_01
td_val_elec_02 1 #td_val_elec_02
td_val_elec_03 1 #td_val_elec_03
td_vext 0 #add extern potential or not
td_vext_dire 1 #extern potential direction
td_stype 0 #space domain type
Expand Down
6 changes: 0 additions & 6 deletions source/module_io/test/input_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,6 @@ TEST_F(InputTest, Default)
EXPECT_DOUBLE_EQ(INPUT.soc_lambda,1.0);
EXPECT_EQ(INPUT.input_error,0);
EXPECT_DOUBLE_EQ(INPUT.td_force_dt,0.02);
EXPECT_EQ(INPUT.td_val_elec_01,1);
EXPECT_EQ(INPUT.td_val_elec_02,1);
EXPECT_EQ(INPUT.td_val_elec_03,1);
EXPECT_FALSE(INPUT.td_vext);
EXPECT_EQ(INPUT.td_vext_dire,"1");
EXPECT_EQ(INPUT.td_stype,0);
Expand Down Expand Up @@ -571,9 +568,6 @@ TEST_F(InputTest, Read)
EXPECT_DOUBLE_EQ(INPUT.soc_lambda,1.0);
EXPECT_EQ(INPUT.input_error,0);
EXPECT_DOUBLE_EQ(INPUT.td_force_dt,0.02);
EXPECT_EQ(INPUT.td_val_elec_01,1);
EXPECT_EQ(INPUT.td_val_elec_02,1);
EXPECT_EQ(INPUT.td_val_elec_03,1);
EXPECT_EQ(INPUT.td_vext,0);
// EXPECT_EQ(INPUT.td_vext_dire,"1");
EXPECT_EQ(INPUT.td_stype,0);
Expand Down
3 changes: 0 additions & 3 deletions source/module_io/write_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,6 @@ ModuleBase::GlobalFunc::OUTP(ofs, "out_bandgap", out_bandgap, "if true, print ou

ofs << "\n#Parameters (16.tddft)" << std::endl;
ModuleBase::GlobalFunc::OUTP(ofs, "td_force_dt", td_force_dt, "time of force change");
ModuleBase::GlobalFunc::OUTP(ofs, "td_val_elec_01", td_val_elec_01, "td_val_elec_01");
ModuleBase::GlobalFunc::OUTP(ofs, "td_val_elec_02", td_val_elec_02, "td_val_elec_02");
ModuleBase::GlobalFunc::OUTP(ofs, "td_val_elec_03", td_val_elec_03, "td_val_elec_03");
ModuleBase::GlobalFunc::OUTP(ofs, "td_vext", td_vext, "add extern potential or not");
ModuleBase::GlobalFunc::OUTP(ofs, "td_vext_dire", td_vext_dire, "extern potential direction");
ModuleBase::GlobalFunc::OUTP(ofs, "out_dipole", out_dipole, "output dipole or not");
Expand Down
8 changes: 4 additions & 4 deletions tests/integrate/601_NO_TDDFT_CO/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -602.8643309778789
etotperatomref -301.4321654889
etotref -602.8643309993128
etotperatomref -301.4321654997
totalforceref 16.350762
totalstressref 30.184707
totaltimeref +8.5807
totalstressref 30.184735
totaltimeref +7.1335
8 changes: 4 additions & 4 deletions tests/integrate/601_NO_TDDFT_CO_occ/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -602.8643309786496
etotperatomref -301.4321654893
etotref -602.8643311305311
etotperatomref -301.4321655653
totalforceref 16.350762
totalstressref 30.184729
totaltimeref +8.5178
totalstressref 30.185015
totaltimeref +7.0590
4 changes: 2 additions & 2 deletions tests/integrate/601_NO_TDDFT_H2/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -18.05421597489365
etotref -18.05421597483996
etotperatomref -9.0271079874
totalforceref 44.953238
totalstressref 79.612084
totaltimeref +8.0145
totaltimeref +3.7961
10 changes: 5 additions & 5 deletions tests/integrate/601_NO_TDDFT_H2_kpoint/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -18.05387244304529
etotperatomref -9.0269362215
totalforceref 45.003706
totalstressref 79.777732
totaltimeref +6.7899
etotref -18.05362763740304
etotperatomref -9.0268138187
totalforceref 44.990644
totalstressref 79.754356
totaltimeref +3.8596
10 changes: 5 additions & 5 deletions tests/integrate/601_NO_TDDFT_H2_len_gauss/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -31.36567840538823
etotperatomref -15.6828392027
totalforceref 0.578716
totalstressref 5.434008
totaltimeref +5.1729
etotref -31.36567798859614
etotperatomref -15.6828389943
totalforceref 0.578604
totalstressref 5.433996
totaltimeref +3.9632
10 changes: 5 additions & 5 deletions tests/integrate/601_NO_TDDFT_H2_len_gauss_dire/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -31.36554134768115
etotperatomref -15.6827706738
totalforceref 0.577344
totalstressref 5.434175
totaltimeref +5.1576
etotref -31.36554049797190
etotperatomref -15.6827702490
totalforceref 0.577232
totalstressref 5.434161
totaltimeref +4.0295
10 changes: 5 additions & 5 deletions tests/integrate/601_NO_TDDFT_H2_len_heavi/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -38.85116741796947
etotperatomref -19.4255837090
totalforceref 0.568680
totalstressref 77.448522
totaltimeref +5.0160
etotref -38.85116666973314
etotperatomref -19.4255833349
totalforceref 0.568498
totalstressref 77.448537
totaltimeref +3.8784
10 changes: 5 additions & 5 deletions tests/integrate/601_NO_TDDFT_H2_len_hhg/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -82.60900810491984
etotperatomref -41.3045040525
totalforceref 0.757204
totalstressref 500.961261
totaltimeref +5.5047
etotref -82.60904651293552
etotperatomref -41.3045232565
totalforceref 0.754930
totalstressref 500.961654
totaltimeref +4.0425
10 changes: 5 additions & 5 deletions tests/integrate/601_NO_TDDFT_H2_len_trape/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -30.92097334578261
etotperatomref -15.4604866729
totalforceref 0.578804
totalstressref 1.159829
totaltimeref +4.0557
etotref -30.92097257037962
etotperatomref -15.4604862852
totalforceref 0.578690
totalstressref 1.159819
totaltimeref +3.5993
10 changes: 5 additions & 5 deletions tests/integrate/601_NO_TDDFT_H2_len_trigo/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -30.91150694066410
etotperatomref -15.4557534703
totalforceref 0.578804
totalstressref 1.068851
totaltimeref +4.6392
etotref -30.91150616526584
etotperatomref -15.4557530826
totalforceref 0.578692
totalstressref 1.068838
totaltimeref +3.6067
10 changes: 5 additions & 5 deletions tests/integrate/601_NO_TDDFT_H2_oldedm/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -18.05387244303919
etotperatomref -9.0269362215
totalforceref 45.003706
totalstressref 79.777732
totaltimeref +5.0273
etotref -18.05362763740304
etotperatomref -9.0268138187
totalforceref 44.990644
totalstressref 79.754356
totaltimeref +3.8057
6 changes: 3 additions & 3 deletions tests/integrate/601_NO_TDDFT_O3/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -1335.872362262912
etotperatomref -445.2907874210
etotref -1335.872362260576
etotperatomref -445.2907874202
totalforceref 13.319759
totalstressref 54.934057
totaltimeref +27.907
totaltimeref +23.556
10 changes: 5 additions & 5 deletions tests/integrate/601_NO_TDDFT_graphene_kpoint/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -257.4519769034942
etotperatomref -85.8173256345
totalforceref 10.905441
totalstressref 2485.841436
totaltimeref +84.603
etotref -321.2175762983792
etotperatomref -107.0725254328
totalforceref 13.778433
totalstressref 1806.432527
totaltimeref +35.306