tNCS test: the near-extinct synthetic clear of the gate, and its counterpart

"A near-extinct class is reported as a sub-lattice" built its crystal with the
weak class at 2% of the strong, which reads a modulation of 19.996x against
the 20x gate: FFTW's rounding of the Patterson put it over, pocketfft's under.
Swept on the same synthetic: depth 0.90/0.95/0.96/0.97/0.98 read
12.0/18.0/20.0/22.8/26.2x. The test now uses the weak class at 1% (26x), and
also checks the other side of the gate, which it did not before: a deep but
genuine pseudo-symmetry (weak class at 5%, 12x) is detected and NOT reported
as near-extinct.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UqXYdJDrM65gxsCn2PrbfK
This commit is contained in:
leonarski_fandClaude Opus 5.5 committed 2026-11-16 06:11:40 +01:00
1 parent 01017c4bb7
commit cfe15f2343
1 file changed
+9 -1
+9 -1
View File
@@ -254,13 +254,21 @@ TEST_CASE("A near-extinct class is reported as a sub-lattice", "[tncs]") {
const gemmi::UnitCell cell = Cell(70.0, 85.0, 110.0);
const gemmi::SpaceGroup *sg = gemmi::find_spacegroup_by_name("P 1 2 1");
const std::array<double, 3> u{0.0, 0.425, 0.5}; // no p/q with q <= 6 fits the whole vector
const auto merged = Synthetic(cell, "P 1 2 1", &u, 0.96); // weak class at 2% of the strong
// The weak class at 1% of the strong reads a modulation of 26x, clear of the 20x gate; at 2% it
// read 20.0x, on the gate itself, and the FFT's rounding decided the outcome.
const auto merged = Synthetic(cell, "P 1 2 1", &u, 0.98);
const auto r = AnalyzeTranslationalNCS(merged, cell, sg);
REQUIRE(r.measurable);
REQUIRE(r.detected);
CHECK_FALSE(r.commensurate);
CHECK(r.near_extinct_class);
CHECK(TranslationalNCSToText(r).find("supercell candidate") != std::string::npos);
// A deep but genuine pseudo-symmetry - the weak class at 5% of the strong, a 12x modulation - is
// not one.
const auto deep = AnalyzeTranslationalNCS(Synthetic(cell, "P 1 2 1", &u, 0.90), cell, sg);
REQUIRE(deep.detected);
CHECK_FALSE(deep.near_extinct_class);
}
// The vector is not only reported: the L-test picks its partner steps with it and the twin-immune