ProperSubgroup: the translations count, on some origin of the subgroup

Comparing rotations only passed a model group with a pure 2-fold where the data's group has a
2(1) (P 1 2 1 against P 21 21 2): the model was then refined in its own group, its copies
overlaid where the data have none, and the twin arm switched off. Each operator must now be
one of the larger group's once the subgroup's origin is moved by some p (an operator (R, t)
reads (R, t + (R - 1) p)), so P 1 21 1 in P 21 21 21 (origin z + 1/4) still passes.

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 07:48:55 +01:00
1 parent cebf90af10
commit b3e20dd62b
3 files changed
+32 -2

No files matched your search

@@ -4150,7 +4150,31 @@ bool ProperSubgroup(const gemmi::GroupOps &sub, const gemmi::GroupOps &super) {
for (const gemmi::Op::Tran &cen : sub.cen_ops)
if (std::find(super.cen_ops.begin(), super.cen_ops.end(), cen) == super.cen_ops.end())
return false;
return true;
// The translations too, on some origin of sub: moved by p, its operator (R, t) reads (R, t + (R - 1) p). The
// rotations alone also pass a 2 where super has a 2(1) - P 1 2 1 is a subgroup of P 21 21 2 on no origin, and a
// model refined under it would overlay copies where the data have none.
constexpr int D = gemmi::Op::DEN;
for (int px = 0; px < D; ++px)
for (int py = 0; py < D; ++py)
for (int pz = 0; pz < D; ++pz) {
const int p[3] = {px, py, pz};
bool all = true;
for (const gemmi::Op &op : sub.sym_ops) {
gemmi::Op moved = op;
for (int i = 0; i < 3; ++i)
moved.tran[i] += (op.rot[i][0] * px + op.rot[i][1] * py + op.rot[i][2] * pz) / D - p[i];
moved.wrap();
const gemmi::Op &s = *super.find_by_rotation(op.rot);
if (std::none_of(super.cen_ops.begin(), super.cen_ops.end(),
[&](const gemmi::Op::Tran &cen) { return s.add_centering(cen) == moved; })) {
all = false;
break;
}
}
if (all)
return true;
}
return false;
}
std::vector<MergedReflection> ExpandToSubgroup(const std::vector<MergedReflection> &merged, const gemmi::SpaceGroup &from,
@@ -284,7 +284,8 @@ struct RefinementResult {
// As REFMAC5 keeps twin-related reflections in one set (Roversi et al. (2012) Acta Cryst. D68, 418-424)
int CloseFreeSet(std::vector<MergedReflection> &merged, const gemmi::UnitCell &cell, const gemmi::SpaceGroup &sg);
// Whether every operation of `sub` is one of `super`'s (its rotation, and its centring), `super` the larger group:
// Whether every operation of `sub` is one of `super`'s (its rotation, its translation on some origin of `sub`, and its
// centring), `super` the larger group:
// `sub` is then a group the data merged in `super` could not tell from it (a P2(1) crystal whose copies are
// pseudo-symmetric, merged in P4(1)2(1)2).
bool ProperSubgroup(const gemmi::GroupOps &sub, const gemmi::GroupOps &super);
+5
View File
@@ -1281,6 +1281,11 @@ TEST_CASE("Refinement_model_in_a_subgroup_of_the_data", "[Refinement]") {
CHECK(!ProperSubgroup(super.operations(), sub.operations()));
CHECK(!ProperSubgroup(sub.operations(), sub.operations()));
CHECK(!ProperSubgroup(gemmi::find_spacegroup_by_name("C 1 2 1")->operations(), super.operations()));
// the translations count, on any origin of the subgroup
const gemmi::GroupOps p21212 = gemmi::find_spacegroup_by_name("P 21 21 2")->operations();
CHECK(ProperSubgroup(gemmi::find_spacegroup_by_name("P 1 21 1")->operations(), p21212));
CHECK(ProperSubgroup(gemmi::find_spacegroup_by_name("P 1 1 2")->operations(), p21212));
CHECK(!ProperSubgroup(gemmi::find_spacegroup_by_name("P 1 2 1")->operations(), p21212));
gemmi::Structure truth = residue_crystal({"TRP"}, cell, "P 1 21 1", 5);
{
// the residue's mate by the 2-fold along a, exact: the crystal is then P 2 2(1) 1 (pseudo-P2(1)2(1)2(1))