Skip to content

Commit 122eacc

Browse files
committed
clearer diagratio handling
1 parent 250db62 commit 122eacc

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

c++/core.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,17 @@ void prepare_floquet_for_truncation(const Step &step, Operators<S> &operators, S
170170
diag.report(true);
171171
}
172172

173+
inline double initial_diagratio_for_step(const Step &step, const Params &P) {
174+
return step.last() && P.keep_all_states_in_last_step() ? 1.0 : double(P.diagratio);
175+
}
176+
173177
template<scalar S>
174178
auto do_diag(const Step &step, Operators<S> &operators, const Coef<S> &coef, Stats<S> &stats, const DiagInfo<S> &diagprev,
175179
Output<S> &output, const TaskList &tasklist, const SubspaceStructure &substruct, Oprecalc<S> &oprecalc,
176180
const Symmetry<S> *Sym, DiagEngine<S> *eng, MemTime &mt, const Params &P) {
177181
step.infostring();
178182
Sym->show_coefficients(step, coef);
179-
double diagratio = P.diagratio; // non-const
183+
double diagratio = initial_diagratio_for_step(step, P); // non-const
180184
DiagInfo<S> diag;
181185
while (true) {
182186
try {

0 commit comments

Comments
 (0)