Twinning report: warn when a promotion stands on intensities below a perfect twin's; flag compressed twin-immune zone controls

A promoted point group whose <|L|> reads below 0.375 (NOT_READABLE) previously
raised no TWINNING warning at all; a twinned subgroup whose law the promotion
absorbed predicts the same data, so the adopted group is not confirmed. Warn.

The twin-immune zone control reading more compressed than a perfect twin's
acentric population (0.541) is something no twin fraction produces (overlap or
neighbour correlation); genuine symmetry then reads acentric in its zones too
(measured: a genuine 622 with its control at 0.528 read its 2-folds at -950 to
-2640 nats). Such zones are now marked ambiguous in the text and the zone
decision line. Report-only: no decision and no output file but the report changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K5K8jvPPbmCrbqnWkddTuB
This commit is contained in:
leonarski_fandClaude Opus 5.5 committed 2026-10-03 21:40:51 +02:00
1 parent 581e1c8ca2
commit 42441ac328
4 files changed
+33 -1

No files matched your search

@@ -596,6 +596,10 @@ namespace {
result.control.evidence_nats - result.control.n * result.control_excess_per_reflection;
for (auto& z : result.zones)
z.calibrated_evidence_nats = z.evidence_nats - z.n * result.control_excess_per_reflection;
constexpr double PERFECT_TWIN_ACENTRIC_MEAN_ABS_E2_MINUS_1 = 0.541;
result.zones_ambiguous = result.control.n > 0
&& result.control.mean_abs_e2_minus_1 + 3.0 * result.control.standard_error
< PERFECT_TWIN_ACENTRIC_MEAN_ABS_E2_MINUS_1;
}
}
@@ -862,5 +866,11 @@ std::string TwinImmuneZonesToText(const TwinImmuneZoneResult& result) {
for (const auto& z : result.zones)
row(z);
row(result.control);
if (result.zones_ambiguous)
os << " The control reads more compressed than a perfect twin's acentric reflections (0.541), which\n"
" no twin fraction can do: something else - overlapping spots, neighbour correlation - averages\n"
" each reflection with unrelated ones, and it compresses the zones as well. Genuine symmetry then\n"
" reads acentric in its zones too, so here they do not separate a twinned subgroup from the\n"
" adopted group, and no verdict is read from them either way.\n";
return os.str();
}
@@ -143,6 +143,15 @@ struct TwinImmuneZoneResult {
// nats were the normalisation's, and the verdict rescued a twin law. Calibrated, that zone reads
// -115 nats; the zones of genuine promotions keep +140 nats (a 90 deg tetragonal sweep) to +2000.
double control_excess_per_reflection = 0.0;
// The control reads more compressed than a PERFECT twin's acentric population (<|E^2-1|> 0.541, by
// more than three standard errors). Twinning cannot do that at any fraction, so something else
// averages each reflection with unrelated ones - overlapping spots of a long cell, neighbour
// correlation - and it compresses the zones as much as the control: genuine symmetry then reads
// acentric in its zones. Measured on the open battery: a 622 crystal with its control at 0.528
// read its genuine 2-folds at -950 to -2640 nats, and a twinned 4/m crystal promoted to 4/mmm, its
// control at 0.454, read its added operators at -226 to -616. The zones are reported, but no
// verdict is read from them either way.
bool zones_ambiguous = false;
double anisotropy_delta_b_A2 = 0.0; // the anisotropy taken out of the intensities before normalising
double d_max_A = 0.0; // resolution range of the shells read
double d_min_A = 0.0;
+11
View File
@@ -1663,6 +1663,17 @@ ReportDocument BuildReportDocument(const std::string &output_prefix,
Warn(doc, PathologyCode::TWINNING, fmt::format(
"Twinning is indicated ({}) - refinement against the merged data needs a twin law",
TwinningVerdictLine(tw)));
else if (abnormal && tw.laue_class_was_chosen_by_promotion && tw.mean_abs_l < 0.375)
// Below a perfect twin's 0.375 the L-test says nothing about the twin fraction, but it does
// say the intensities are at least as twin-like as a perfect twin's - and a perfect twin of
// a subgroup, its law absorbed by the promotion, predicts exactly the data the promoted
// group does. The promotion is then unconfirmed, however clean its operators look.
Warn(doc, PathologyCode::TWINNING, fmt::format(
"The point group was promoted although the intensities read at least as twin-like as a "
"perfect twin's (<|L|> = {:.3f}, below 0.375): a twin of a subgroup whose law the promotion "
"absorbed predicts the same data, so the adopted group is not confirmed - refine in the "
"subgroup with that twin law too (p_P1.mtz carries the same observations)",
tw.mean_abs_l));
}
// ---- radiation damage
+3 -1
View File
@@ -2103,7 +2103,9 @@ namespace {
zone.standard_error, z.control.mean_abs_e2_minus_1, z.control_excess_per_reflection,
zone.evidence_nats, zone.calibrated_evidence_nats, z.d_max_A, z.d_min_A,
z.tncs_normalised ? ", normalised per pseudo-translation class" : "",
verdict < 0 ? "acentric, the added operators are a twin law or a pseudo-symmetry"
verdict < 0 && z.zones_ambiguous
? "acentric, but the control is compressed beyond a perfect twin, so genuine symmetry would read so too"
: verdict < 0 ? "acentric, the added operators are a twin law or a pseudo-symmetry"
: verdict > 0 ? "centric, the added operators are real" : "undecided");
// Recorded only where the zone DECIDED something. An undecided read decides nothing - the
// rule stays as it was - and recording it had the report announce "a twin gate refused this