A device (400) for optical matrix-vector multiplication is provided. A x → = y → , encompassing: n*m optically coupled cells (i,j) (330-339) representing the elements of an (n × m) matrix A, an input vector x → , whose components x i (221-226) are represented by n waveguides which are coupled to the rows of matrix A, forming an output vector y → , whose components y j (231-236) are represented by m waveguides coupled to the columns of matrix A, each
cell (i,j) (330-339) containing an optical element (350) which is a
matrix element a ijmodeled, further comprising: a set of optical amplifiers (411 - 416) connecting a g-th column of cells with a g+1-th column of cells in the row direction, wherein each
optical amplifier (411 - 416) connects a
cell (i,g) with its neighboring
cell (i,g+1), and / or a set of optical amplifiers (421 - 426) connecting an h-th row of cells with an h+1-th row of cells in the column direction, wherein each
optical amplifier (421 - 426) connects a cell (h,j) with its neighboring cell (h+1,j).