  In this paper we study the concept of using the interaction between waves and
a trainable medium in order to construct a matrix-vector multiplier. In
particular we study such a device in the context of the backpropagation
algorithm, which is commonly used for training neural networks. Here, the
weights of the connections between neurons are trained by multiplying a
`forward' signal with a backwards propagating `error' signal. We show that this
concept can be extended to trainable media, where the gradient for the local
wave number is given by multiplying signal waves and error waves. We provide a
numerical example of such a system with waves traveling freely in a trainable
medium, and we discuss a potential way to build such a device in an integrated
photonics chip.
