Skip to content

Commit 1c06032

Browse files
committed
Small fix
1 parent be477c3 commit 1c06032

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lindbladmpo.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -685,10 +685,11 @@ int main(int argc, char *argv[])
685685
cout2 << "New max bond dimension of rho:" << maxLinkDim(C.rho) << "\n";
686686
cout2.flush();
687687
}
688+
const bool b_force_rho_trace = param.boolval("b_force_rho_trace");
688689

689690
Cplx tr = C.trace_rho();
690691
cout2 << "Tr{rho}: " << tr;
691-
if (std::abs(tr - 1) > TRACE_RHO_DIV_THRESHOLD)
692+
if ((std::abs(tr - 1) > TRACE_RHO_DIV_THRESHOLD) && b_force_rho_trace)
692693
{
693694
cout2 << ", normalizing.";
694695
C.rho /= tr;
@@ -911,7 +912,7 @@ int main(int argc, char *argv[])
911912
if (std::abs(z) < _2_N)
912913
cout2 << "\t\tNote: " << "Tr{rho} = " << z << " encountered during collapse projectors, "
913914
<< "this is smaller than 2^(-N)!";
914-
C.rho /= z;
915+
// C.rho /= z;
915916
}
916917
if (i_coll == 0)
917918
rho_c = MPS(C.rho);
@@ -927,14 +928,13 @@ int main(int argc, char *argv[])
927928
cout2 << "\t\tNote: this is smaller than 2^(-N)!"
928929
<< "\n";
929930
// TODO: This is a somewhat arbitrary threshold for the warning.
930-
C.rho /= z;
931+
// C.rho /= z;
931932
auto t_collapse_end = steady_clock::now();
932933
duration_ms = duration_cast<milliseconds>(t_collapse_end - t_collapse_start);
933934
cout2 << "Collapse evaluation terminated. Duration: " << duration_ms.count() / 1000. << "s\n";
934935
}
935936

936937
char buf[100];
937-
const bool b_force_rho_trace = param.boolval("b_force_rho_trace");
938938
const long force_rho_hermitian_step = param.longval("force_rho_hermitian_step");
939939
const long force_rho_hermitian_gates = param.longval("force_rho_hermitian_gates");
940940
const bool b_quiet = param.boolval("b_quiet");

0 commit comments

Comments
 (0)