labeler

qcmanybody.utils.labeler(mc_level_lbl, frag, bas, *, opaque=True)[source]

Form label from model chemistry id and fragment and basis indices.

Parameters:
  • mc_level_lbl (Union[str, int, None]) – Key identifying the model chemistry. May be “(auto)”. Often the ManyBodyInput.specification.specification keys. When opaque=False, result is for pretty printing so instead of a string, mc_level_lbl might be an integer index (apply 1-indexing beforehand) or None (if the model chemistry part is unwanted because single-level).

  • frag (Tuple[int, ...]) – List of 1-indexed fragments active in the supersystem.

  • bas (Tuple[int, ...]) – List of 1-indexed fragments with active basis sets in the supersystem. All those in frag plus any ghost.

  • opaque (bool) – Toggle whether to return JSON-friendly semi-opaque internal str label (True) or eye-friendly label with @ for basis and § for model chemistry (False).

Returns:

JSON string from inputs:

labeler("mp2", 1, (1, 2))
#> '["mp2", [1], [1, 2]]'
labeler("mp2", 1, (1, 2), opaque=False)
#> '§mp2_(1)@(1, 2)'

Return type:

str