dimod.binary.quicksum

quicksum(iterable: Iterable[Union[dimod.binary.binary_quadratic_model.BinaryQuadraticModel, dimod.quadratic.quadratic_model.QuadraticModel, int, float, numpy.number]]) Union[dimod.binary.binary_quadratic_model.BinaryQuadraticModel, dimod.quadratic.quadratic_model.QuadraticModel][source]

Sum iterable’s items.

This function is an alternative to the built-in sum(). It is generally faster when adding many BinaryQuadraticModels and QuadraticModels because it creates fewer intermediate objects.