Commit 0d43cb54 authored by Dmitry I. Lyakh's avatar Dmitry I. Lyakh
Browse files

Added iteration timer to Optimizer and Reconstructor


Signed-off-by: default avatarDmitry I. Lyakh <quant4me@gmail.com>
parent 4709054d
/** ExaTN:: Variational optimizer of a closed symmetric tensor network expansion functional
REVISION: 2021/11/19
REVISION: 2021/11/21
Copyright (C) 2018-2021 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2021 Oak Ridge National Laboratory (UT-Battelle) **/
......@@ -296,7 +296,9 @@ bool TensorNetworkOptimizer::optimize_sd(const ProcessGroup & process_group)
unsigned int iteration = 0;
while((!converged) && (iteration < max_iterations_)){
if(TensorNetworkOptimizer::debug > 0)
std::cout << "#DEBUG(exatn::TensorNetworkOptimizer): Iteration " << iteration << std::endl;
std::cout << "#DEBUG(exatn::TensorNetworkOptimizer)["
<< std::fixed << std::setprecision(6) << exatn::Timer::timeInSecHR(numericalServer->getTimeStampStart())
<< "]: Iteration " << iteration << std::endl;
converged = true;
double max_convergence = 0.0;
average_expect_val_ = std::complex<double>{0.0,0.0};
......
/** ExaTN:: Reconstructs an approximate tensor network expansion for a given tensor network expansion
REVISION: 2021/11/19
REVISION: 2021/11/21
Copyright (C) 2018-2021 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2021 Oak Ridge National Laboratory (UT-Battelle) **/
......@@ -282,7 +282,9 @@ bool TensorNetworkReconstructor::reconstruct_sd(const ProcessGroup & process_gro
unsigned int iteration = 0;
while((!converged) && (iteration < max_iterations_)){
if(TensorNetworkReconstructor::debug > 0)
std::cout << "#DEBUG(exatn::TensorNetworkReconstructor): Iteration " << iteration << std::endl;
std::cout << "#DEBUG(exatn::TensorNetworkReconstructor)["
<< std::fixed << std::setprecision(6) << exatn::Timer::timeInSecHR(numericalServer->getTimeStampStart())
<< "]: Iteration " << iteration << std::endl;
double max_grad_norm = 0.0;
for(auto & environment: environments_){
//Nesterov extrapolation:
......
......@@ -3607,7 +3607,7 @@ TEST(NumServerTester, ExcitedMCVQE) {
const std::string tn_type = "TTN"; //MPS or TTN
const double accuracy = 1e-4;
exatn::resetLoggingLevel(1,2); //debug
//exatn::resetLoggingLevel(1,2); //debug
bool success = true;
bool root = (exatn::getProcessRank() == 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment