Hi everyone. I’m working on quantum neural networks for computer vision. I wonder if there is a better or more efficient way to implement quantum version of convolution rather than using a number of for loops like the one demonstrated in this tutorial? Josh suggested me to use Dask to parallelize QNode computations (Thanks @josh again! ). However, it seems I did not use it correctly because when I executed the demo codes provided in the documentation of Dask, I found the computation got even much slower. Here is the code I run:
import dask import numpy as np def inc(x): return x + 1 def double(x): return x * 2 def add(x, y): return x + y data = np.random.rand((100)) t0 = time.time() output =  for x in data: a = dask.delayed(inc)(x) b = dask.delayed(double)(x) c = dask.delayed(add)(a, b) output.append(c) total = dask.delayed(sum)(output) total.compute() t1 = time.time() print("Time: ", (t1 - t0) ) t0 = time.time() output =  for x in data: a = (inc)(x) b = (double)(x) c = (add)(a, b) output.append(c) total = (sum)(output) t1 = time.time() print("Time: ", (t1 - t0) ) Time: 0.034467220306396484 Time: 0.0003325939178466797
Could anyone help me with it? Many thanks!