cancel_identical_terms function

(Shortest import: from brian2.codegen.optimisation import cancel_identical_terms)

brian2.codegen.optimisation.cancel_identical_terms(primary, inverted)[source]

Cancel terms in a collection, e.g. a+b-a should be cancelled to b

Simply renders the nodes into expressions and removes whenever there is a common expression in primary and inverted.