Included the measure for the inner products everywhere.

This commit is contained in:
Karthik 2025-04-25 17:48:13 +02:00
parent f42c5ab0de
commit cf5d3fd209

View File

@ -147,7 +147,7 @@ function [psi] = runGradientDescent(this,psi,Params,Transf,VDk,V,Observ)
theta = compute_optimal_theta(p, muchem, psi, Params, Transf, VDk, V);
% Update solution
gamma = 1 / sqrt(sum(abs(p(:)).^2));
gamma = 1 / sqrt(sum(abs(p(:)).^2) * Transf.dx * Transf.dy * Transf.dz);
psi = (cos(theta).*psi) + (gamma*sin(theta).*p);
% Normalize psi
Norm = sum(abs(psi(:)).^2) * Transf.dx * Transf.dy * Transf.dz;
@ -261,8 +261,8 @@ function theta = compute_optimal_theta(p, muchem, psi, Params, Transf, VDk, V)
Hpsi = compute_gradient(psi, Params, Transf, VDk, V);
Hp = compute_gradient(p, Params, Transf, VDk, V);
g = compute_g(psi, p, Params, VDk);
gamma = 1 / sqrt(sum(abs(p(:)).^2));
numerator = real(p(:)' * Hpsi(:) * Transf.dx * Transf.dy * Transf.dz)/gamma;
gamma = 1 / sqrt(sum(abs(p(:)).^2) * Transf.dx * Transf.dy * Transf.dz);
numerator = gamma * real(p(:)' * Hpsi(:) * Transf.dx * Transf.dy * Transf.dz);
denominator = muchem - (gamma^2 * (real(p(:)' * Hp(:) * Transf.dx * Transf.dy * Transf.dz) + real(g(:)' * p(:) * Transf.dx * Transf.dy * Transf.dz)));
theta = numerator / denominator;