diff --git a/rugnux/RugnuxPasses.cpp b/rugnux/RugnuxPasses.cpp index eb0db145d..c196c1731 100644 --- a/rugnux/RugnuxPasses.cpp +++ b/rugnux/RugnuxPasses.cpp @@ -1698,12 +1698,23 @@ ProcessResult Rugnux::DoubledCellHypothesis(RugnuxObserver *observer, ProcessRes "modulates, by shell:{}", tr.parity[0], tr.parity[1], tr.parity[2], tr.eps[0], tr.eps[1], tr.eps[2], table); const bool one_translation = tr.tested && weakest->modulated_share >= 0.5; - const bool adopt = one_translation; + // A superstructure cannot be more symmetric than its own average: the half cell's merge is that + // average, so a doubled merge that reads a point group of higher order than the half cell's describes + // something other than the crystal's superstructure (measured: a C2221 half cell whose doubled merge + // came out centrosymmetric, Cccm, with the added class otherwise passing every test). + const auto point_group_order = [](const ProcessResult &r) { + return r.space_group ? r.space_group->operations().sym_ops.size() : size_t{0}; + }; + const bool symmetry_raised = point_group_order(d) > point_group_order(half); + const bool adopt = one_translation && !symmetry_raised; ProcessResult::DoubledCell h; h.adopted = adopt; h.decision = adopt ? fmt::format("{}; and one pseudo-translation accounts for most of it in every shell (at least {:.2f}, " "at {:.1f}-{:.1f} A)", rises, weakest->modulated_share, weakest->d_low_A, weakest->d_high_A) + : symmetry_raised + ? fmt::format("the probed cell stands: the doubled merge reads {}, more symmetric than the half cell's {}, " + "which a superstructure of it cannot be", d.space_group->xhm(), half.space_group->xhm()) : !tr.tested ? std::string("the probed cell stands: the added class could not be read in the doubled merge") : fmt::format("the probed cell stands: one pseudo-translation accounts for only {:.2f} of the added class "