Skip to content

Commit 44e7a12

Browse files
authored
Merge pull request #1 from zzh535897/zzh535897-patch-1
Zzh535897 patch 1
2 parents 084c43a + 9307291 commit 44e7a12

4 files changed

Lines changed: 43 additions & 47 deletions

File tree

README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
1-
### QPC-TDSE-CPC
1+
# QPC-TDSE-CPC
22
The CPC library version of QPC-TDSE[[1]](https://doi.org/10.1016/j.cpc.2023.108787).
33

44
Stable version.
55

66
Please note this repo is for documentation. Usual developement will NOT be made to this repo. Bug fixing and new features are tested elsewhere, and will be gathered to this repo if a new stable version is formulated.
77

8-
### References
8+
9+
## Issues
10+
2023.9.11<br>
11+
(1) The missing scaling factor sqrt(2E) in the analysis script plot_part.m has been corrected.
12+
13+
(2) The format of output "proj_val" for the real-time projection onto bound states has been corrected. Now it follows the format in the user guide.
14+
15+
## Important
16+
2023.9.11<br>
17+
(1) The variable "lmd1" in an output file actually differs a phase factor to the P_{lm}(E) as
18+
19+
LMD(k,m,l)= (-i)^l \exp(i\Delta_{l}(k)) P_{lm}(E)
20+
21+
Here P_{lm}(E) is defined in eq.(58). This feature will not affect the use of eq.(65), but could cause confusion when calculating physical quantities such as the time-delay.
22+
23+
(2) The gaussian envelope in the original release is really "gaussian", which means it is non-zero everywhere. The simulation starts and ends at 2FWHM far from its central peak. If the PCS method is applied for this case, some unphysical results would occur since the instantaneous A(t_f) is non-zero.
24+
25+
A modified gaussian envelope with its tail cut should be customized instead. One may refer to include/structure/field.h for its format.
26+
27+
(3) The projection onto field-free eigenstates could differ a sign between two runs using different box size parameters in the paper version code, since the LAPACK diagonalization routines randomly choose the sign of the eigenvectors. This may cause some confusion.
28+
29+
In the latest version we always fix the sign of eigen states to be positive near the origin.
30+
31+
## References
932
[1] Zhao-Han Zhang, Yang Li, Yi-Jia Mao, Feng He,
1033
*QPC-TDSE: A parallel TDSE solver for atoms and small molecules in strong lasers*
1134
[Comput. Phys. Comm., **290** 108787 (2023)]

analysis/plot_part.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
figure;hold on;
44
for im=1:nm
55
for il=1:nl
6-
plot(pr.^2/2,squeeze(abs(lmd(im,il,:))).^2,'LineWidth',1.1);
6+
plot(pr.^2/2,pr.*squeeze(abs(lmd(im,il,:))).^2,'LineWidth',1.1);
77
end
88
end
99
xlabel('$E$(a.u.)' ,'Interpreter','latex');
1010
ylabel('$P_{lm}(E)$(a.u.)','Interpreter','latex');
1111
title('Partial-Wave PMD');
1212

1313
figure;hold on;
14-
pes=sum(sum(abs(lmd).^2,1),2);
14+
pes=pr.*sum(sum(abs(lmd).^2,1),2);
1515
plot(pr.^2/2,pes,'k-','LineWidth',1.1);
1616

1717
xlabel('$E$(a.u.)' ,'Interpreter','latex');
1818
ylabel('$P(E)$(a.u.)','Interpreter','latex');
1919
title('PES');
20-
end
20+
end

binsrc/sphTDSE.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,11 @@ namespace proj
438438
for(size_t im=0;im<dims_t::m_dims;++im)
439439
for(size_t il=0;il<dims_t::l_dims;++il)
440440
{
441-
for(size_t ii=0;ii<nnz[im*dims_t::l_dims+il];++ii)
442-
val.push_back(tmp[im*dims_t::l_dims*dims_t::n_dims+il*dims_t::n_dims+ii]);
441+
auto beg = tmp.begin()+im*dims_t::l_dims*dims_t::n_dims+il*dims_t::n_dims;
442+
auto end = beg + nnz[im*dims_t::l_dims+il];
443+
val.insert(val.end(),beg,end);
444+
//for(size_t ii=0;ii<nnz[im*dims_t::l_dims+il];++ii)
445+
//#val.push_back(tmp[im*dims_t::l_dims*dims_t::n_dims+il*dims_t::n_dims+ii]);
443446
}
444447
}
445448
}//end of calc_proj
@@ -449,7 +452,14 @@ namespace proj
449452
{
450453
if constexpr(calculate_proj==1)
451454
{
452-
proj->projection(coef,val,nnz);//calculate projection onto eigen states
455+
proj->projection(coef,tmp,nnz);//calculate projection onto eigen states
456+
for(size_t im=0;im<dims_t::m_dims;++im)
457+
for(size_t il=0;il<dims_t::l_dims;++il)
458+
{
459+
auto beg = tmp.begin()+im*dims_t::l_dims*dims_t::n_dims+il*dims_t::n_dims;
460+
auto end = beg + nnz[im*dims_t::l_dims+il];
461+
val.insert(val.end(),beg,end);
462+
}
453463
file.save((double*)val.data(),val.size()*2ul,"/proj_val");
454464
file.save((size_t*)nnz.data(),nnz.size() ,"/proj_nnz");
455465
}

include/spherical/spectrum/population_1e.hpp

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ struct eigenstate_sph final//to store all required eigenstates and eigenvalues (
9292
for(size_t i=0;i<dims_t::n_dims;++i)
9393
{
9494
if(crit(l,temp_val[i],temp_vec.data()+i*dims_t::n_dims))
95-
crit_result.push_back(i);//requirement: crit(m,l,eig,vec)
95+
crit_result.push_back(i);//requirement: crit(l,eig,vec)
9696
}
9797
//dump all required states
9898
auto& vec_this = vec(l);
@@ -103,6 +103,7 @@ struct eigenstate_sph final//to store all required eigenstates and eigenvalues (
103103
{
104104
size_t s=crit_result[i];
105105
val_this[i]=temp_val[s];
106+
double sig = temp_vec[s*dims_t::n_dims]>0.? 1.:-1.;
106107
//to store the left hand side basis, multiply by S
107108
intrinsic::symb_mul_vecd<dims_t::n_dims,dims_t::n_elem,0>
108109
(
@@ -221,41 +222,3 @@ struct eigenstate_bic final
221222
}//end of initialize
222223

223224
};//end of eigenstate_bic
224-
225-
226-
/*template<class dims_t>
227-
struct [[deprecated]] statistics
228-
{
229-
static inline auto generate_axis_m ()
230-
{//get the m value on (im,il)-grid
231-
auto axis = std::vector<long>(dims_t::m_dims*dims_t::l_dims);
232-
for(size_t im=0;im<dims_t::m_dims;++im)
233-
for(size_t il=0;il<dims_t::l_dims;++il)
234-
{
235-
axis[im*dims_t::l_dims+il]=dims_t::in_m(im);
236-
}
237-
return axis;//use NRVO or move
238-
}//end of generate_axis_m
239-
static inline auto generate_axis_l ()
240-
{//get the l value on (im,il)-grid
241-
auto axis = std::vector<long>(dims_t::m_dims*dims_t::l_dims);
242-
for(size_t im=0;im<dims_t::m_dims;++im)
243-
for(size_t il=0;il<dims_t::l_dims;++il)
244-
{
245-
axis[im*dims_t::l_dims+il]=dims_t::in_l(im,il);
246-
}
247-
return axis;//use NRVO or move
248-
}//end of generate_axis_l
249-
static inline auto generate_dist_ml(const coefficient_view<dims_t>& coef,const operator_sc<dims_t>& oper)
250-
{//evaluate the polulation |P(m,l)|^2 on (im,il)-grid
251-
auto dist = std::vector<double>(dims_t::m_dims*dims_t::l_dims);
252-
#pragma omp parallel for collapse(2)
253-
for(size_t im=0;im<dims_t::m_dims;++im)
254-
for(size_t il=0;il<dims_t::l_dims;++il)
255-
{
256-
dist[im*dims_t::l_dims+il]=norm(oper.observe_rsub(coef(im,il),coef(im,il)));
257-
}
258-
return dist;
259-
}//end of generate_dist_ml
260-
};//end of statistics*/
261-

0 commit comments

Comments
 (0)