Skip to content
Snippets Groups Projects
Commit b7dc344c authored by Rafal Skolasinski's avatar Rafal Skolasinski
Browse files

make use of "as_ordered_terms" in "_extract_hoppings"

parent 1ad3dc71
No related branches found
No related tags found
No related merge requests found
......@@ -405,7 +405,7 @@ def _discretize_expression(expression, coords):
def _extract_hoppings(expr):
"""Read hoppings and perform shortening operation."""
expr = sympy.expand(expr)
summands = expr.args if expr.func == sympy.Add else [expr]
summands = expr.as_ordered_terms()
offset = [_read_offset(s.args[-1]) for s in summands]
coeffs = [sympy.Mul(*s.args[:-1]) for s in summands]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment