order_molecular_formula

qcelemental.molutil.order_molecular_formula(formula, order='alphabetical')[source]

Reorders a molecular formula.

Parameters
  • formula (str) – A molecular formula

  • order (str) – Sorting order of the formula. Valid choices are “alphabetical” and “hill”.

Returns

The molecular formula.

Return type

str