docs: def _factors_for_expand_delta(expr):
      """Yield factors from expr, mixing sympy and QNET
  
      Auxiliary routine for :func:`_expand_delta`.
      """
      from qnet.algebra.core.scalar_algebra import ScalarValue
      from qnet.algebra.core.abstract_quantum_algebra import (
          ScalarTimesQuantumExpression)
      if isinstance(expr, ScalarTimesQuantumExpression):
          yield from _factors_for_expand_delta(expr.coeff)
          yield expr.term
      elif isinstance(expr, ScalarValue):
          yield from _factors_for_expand_delta(expr.val)
      elif isinstance(expr, sympy.Basic) and expr.is_Mul:
          yield from expr.args
      else:
          yield expr