Skip to content

Commit

Permalink
added get_fs function
Browse files Browse the repository at this point in the history
  • Loading branch information
mcocdawc committed Jan 21, 2025
1 parent 39dbd51 commit 15e8156
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/quemb/molbe/chemfrag.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,25 @@ def AO_indices_of_fragment(fragment: set[AtomIdx]) -> set[AOIdx]:
)


def get_fs(
mol: Mole, fragments: AtomPerFrag
) -> dict[CenterIdx, dict[AtomIdx, set[AOIdx]]]:
atom_to_AO = [
range(AO_offsets[2], AO_offsets[3]) for AO_offsets in mol.aoslice_by_atom()
]

def AO_indices_of_fragment(fragment: set[AtomIdx]) -> dict[AtomIdx, set[AOIdx]]:
return {
i_atom: {AOIdx(AO_idx) for AO_idx in atom_to_AO[i_atom]}
for i_atom in fragment
}

return {
i_center: AO_indices_of_fragment(fragment)
for i_center, fragment in fragments.items()
}


def get_edge_idx(fragments: AtomPerFrag) -> dict[CenterIdx, set[CenterIdx]]:
return {
i_center: {
Expand Down

0 comments on commit 15e8156

Please sign in to comment.