title: list comprehension convolution
body: <p>I have a working code like this, but it is rather slow.</p>
  
  <pre><code>def halfconvolution(g,w,dz):
      convo=np.zeros_like(g)
      for i in range(0,len(g)):
          sum=0
          for j in range(0,i):
              sum+=g[j]*w[(i-j)]*dz
          convo[i] = -sum
      return convo
  </code></pre>
  
  <p>I am trying to turn it into a list comprehension, but I am struggling.<br>
  I tried:</p>
  
  <pre><code>convo=[-g*w[i-j] for i in g for j in w]
  </code></pre>