def decompose_formula(formula):
  """Given a string of indices for an argument to an einsum, returns a list
  of the letters used, with '...' treated as an atomic letter.
  """
  formula = formula.replace('...', '.')
  decomposed = []
  for idx in formula:
    if idx == '.':
      decomposed.append('...')
    else:
      decomposed.append(idx)
  return decomposed