Skip to content

Commit

Permalink
mod
Browse files Browse the repository at this point in the history
  • Loading branch information
yomichi committed Nov 10, 2023
1 parent 9619829 commit d9966ba
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
17 changes: 1 addition & 16 deletions src/iTPS/finite_temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,6 @@ void iTPS<tensor>::finite_temperature() {
Timer<> timer;

for (int int_tau = 0; int_tau < nsteps; ++int_tau) {
// DEBUG
std::cerr << int_tau << std::endl;
int debug_site_i = 0;
typename tensor::value_type v;
for (int debug_n = 0; debug_n < Tn[debug_site_i].local_size(); ++debug_n) {
mptensor::Index idx = Tn[debug_site_i].global_index(debug_n);
Tn[debug_site_i].get_value(idx, v);
std::cerr << "DEBUG Tn " << debug_n << " ";
for (int d = 0; d < idx.size(); ++d) {
std::cerr << idx[d] << " ";
}
std::cerr << std::scientific << std::setprecision(std::numeric_limits<double>::max_digits10) << std::real(v) << " " << std::imag(v) << std::endl;
}
std::flush(std::cerr);

auto const& evols = simple_updates;
for (auto up : evols) {
if (up.group != group) {
Expand Down Expand Up @@ -94,7 +79,7 @@ void iTPS<tensor>::finite_temperature() {
} // end of for (int_tau)
if (measure_interval == 0 || nsteps % measure_interval != 0) {
Timer<> timer_m;
measure_density(beta, "TE_");
measure_density(beta, "FT_");
time_measure += timer_m.elapsed();
}
time_simple_update += timer.elapsed() - time_measure;
Expand Down
27 changes: 27 additions & 0 deletions src/iTPS/measure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,33 @@ void iTPS<ptensor>::measure_density(double beta, std::string filename_prefix) {
update_CTM_density();
// }

// DEBUG
#define DUMP_TENSOR(NAME) \
{ \
int site = 0; \
for (int n=0; n < NAME[site].local_size(); ++n){ \
typename ptensor::value_type v; \
mptensor::Index idx = NAME[site].global_index(n); \
NAME[site].get_value(idx, v); \
std::cerr << "DEBUG " #NAME " " << beta << " "; \
for(int d=0; d<idx.size(); ++d){ \
std::cerr << idx[d] << " "; \
} \
std::cerr << std::scientific << std::setprecision(std::numeric_limits<double>::max_digits10) << std::real(v) << " " << std::imag(v) << std::endl; \
} \
}

DUMP_TENSOR(C1);
DUMP_TENSOR(C2);
DUMP_TENSOR(C3);
DUMP_TENSOR(C4);
DUMP_TENSOR(eTl);
DUMP_TENSOR(eTt);
DUMP_TENSOR(eTl);
DUMP_TENSOR(eTb);

#undef DUMP_TENSOR

// auto onesite_obs = measure_onesite_density();
auto onesite_obs = measure_onesite();
save_onesite(onesite_obs, beta, filename_prefix);
Expand Down

0 comments on commit d9966ba

Please sign in to comment.