Skip to content

Commit

Permalink
Make sure bsh_X is verifiable
Browse files Browse the repository at this point in the history
  • Loading branch information
ahurta92 committed Oct 26, 2023
1 parent 495c47d commit f08c003
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/apps/molresponse/FrequencyResponse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,14 @@ auto FrequencyResponse::update_response(World &world, X_space &chi, XCOperator<d
if (r_params.print_level() >= 1) { molresponse::start_timer(world); }

auto x = chi.copy();
auto chi_norm=x.norm2s();
if (world.rank()==0) {
print("x before bsh update: ",chi_norm);
}
X_space theta_X = compute_theta_X(world, x, rho_old, xc, r_params.calc_type());
X_space new_chi = bsh_update_response(world, theta_X, bsh_x_ops, bsh_y_ops, projector, x_shifts);

auto chi_norm=new_chi.norm2s();
chi_norm=new_chi.norm2s();
if (world.rank()==0) {
print("new_chi_norm after bsh update: ",chi_norm);
}
Expand Down Expand Up @@ -306,8 +310,12 @@ auto FrequencyResponse::bsh_update_response(World &world, X_space &theta_X, std:
theta_X.x = theta_X.x * -2;
theta_X.x.truncate_rf();
}
auto chi_norm=theta_X.norm2s();
if (world.rank()==0) {
print("In bsh after theta_X+PQ: ",chi_norm);
}
// apply bsh
X_space bsh_X(world, m, n);
X_space bsh_X=X_space::zero_functions(world, m, n);
bsh_X.set_active(theta_X.active);
bsh_X.x = apply(world, bsh_x_ops, theta_X.x);
if (compute_y) { bsh_X.y = apply(world, bsh_y_ops, theta_X.y); }
Expand All @@ -318,6 +326,10 @@ auto FrequencyResponse::bsh_update_response(World &world, X_space &theta_X, std:
bsh_X.x.truncate_rf();
}

chi_norm=bsh_X.norm2s();
if (world.rank()==0) {
print("In bsh after apply: ",chi_norm);
}
auto apply_projector = [&](auto &xi) { return projector(xi); };
if (compute_y) {
bsh_X = oop_apply(bsh_X, apply_projector);
Expand Down

0 comments on commit f08c003

Please sign in to comment.