Fix deprecation warning for np.sum with generator. (#919)
Fix deprecation warning for np.sum with generator. (#919)

Background:
https://docs.scipy.org/doc/numpy/release.html#numpy-1-15-0-release-notes
"Giving a generator to numpy.sum is now deprecated. This was undocumented behavior, but worked. Previously, it would calculate the sum of the generator expression. In the future, it might return a different result. Use np.sum(np.from_iter(generator)) or the built-in Python sum instead."
quantumlib/Cirq,balopat/Cirq,quantumlib/Cirq,quantumlib/Cirq,quantumlib/Cirq,balopat/Cirq,balopat/Cirq,quantumlib/Cirq