qdk_chemistry.migrate._sbt module
Build SymmetryBlockedTensor JSON from dense spin-channel arrays.
Legacy serializations stored integrals and orbital coefficients as plain dense
arrays; the current schema stores them as SymmetryBlockedTensor documents.
These helpers rebuild the tensor JSON using only the live
qdk_chemistry.data.symmetry bindings and serializing the result, so the
migration never hand-writes the symmetry-blocked JSON layout.
- qdk_chemistry.migrate._sbt.rank2_dict(alpha, beta=None)[source]
Rank-2 spin-diagonal SBT JSON (e.g. one-body integrals, MO coefficients).
alphamay be rectangular (AO x MO); the per-slot extents are taken from its shape.beta is Nonebuilds a spin-restricted tensor.
- qdk_chemistry.migrate._sbt.rank1_dict(alpha, beta=None)[source]
Rank-1 spin-diagonal SBT JSON (e.g. orbital energies).
- qdk_chemistry.migrate._sbt.rank4_dict(aaaa, aabb=None, bbbb=None)[source]
Rank-4 spin-diagonal SBT JSON for two-body integrals.
aabbandbbbb is Nonebuild a spin-restricted tensor: a single underlying block aliased to all four(aaaa, aabb, bbbb, bbaa)spin keys, matching the canonical restricted layout produced by the C++ core.
- qdk_chemistry.migrate._sbt.rank3_three_center_dict(aa, bb=None)[source]
Rank-3 SBT JSON for Cholesky three-center MO integrals.
Each spin block is the dense
[norb**2, naux]matrix (row indexp*norb+q) over two spin-orbital axes and a trivial-symmetry auxiliary axis.bb is Nonebuilds the restricted form (the beta block aliases alpha).
- qdk_chemistry.migrate._sbt.sparse_rank4_dict(entries, norb)[source]
Restricted rank-4
SymmetryBlockedSparseMapJSON from[p, q, r, s, v]entries.
- qdk_chemistry.migrate._sbt.rank4_rdm_dict(aaaa, aabb, bbbb=None)[source]
Rank-4 SBT JSON for a spin-dependent active 2-RDM.
Unlike two-body integrals (where the restricted channels are equal), the same-spin (
aaaa) and opposite-spin (aabb) 2-RDM channels differ.bbbb is Nonebuilds the restricted form: two distinct blocks aliased by the restricted spin orbit (bbbbfromaaaa,bbaafromaabb).