pytc.solver.isdf_xtc_ccsd._x_backing_layout

pytc.solver.isdf_xtc_ccsd._x_backing_layout(x_backing, nocc, nvir, rank)[source]

Detect an X backing’s axis layout: "innermost" or "rank_major".

"innermost" is the historical store layout (nmo, nmo, rank); "rank_major" is (rank, nmo, nmo), where a rank panel is one contiguous block instead of ~nmo^2 strided chunks. An HDF5 backing may declare the layout explicitly via an x_layout attribute (the converter writes it); otherwise the two are told apart by which axis pair is square. Shapes with nmo == rank are genuinely ambiguous and fall back to "innermost" – rank-major stores with nmo == rank MUST carry the attribute.