# An Integrated Photorefractive Analog Matrix-Vector Multiplier for Machine Learning +
## 2 Materials and Methods
### Photorefractive Effect
#### 2.1.3 Two-Wave Mixing  
Experimentally, the photorefractive index writing as shown in Figure 4a can be demonstrated via two-wave mixing [10; 12]. In this experiment, the source and destination write beams are not switched off, and the diffracted grating signal is measured by its interference with the propagating beam.  
Two-wave mixing is an attractive experimental approach, since the interference signal can be orders of magnitude stronger than the diffracted grating signal alone. Namely, a linear intensity interference term is possible since the photorefractive grating is phase shifted with respect to the optical interference pattern (Figure 3), thereby, breaking symmetry between the source and destination channel. Within the limits of perturbation theory, the interference signal then scales linearly with the weak coupling strength of the grating (\(\propto\gamma l\)), rather than quadratically [10]  
\[\Delta I_{D}^{(S)}=\frac{2\kappa\gamma l}{1+\beta}. \tag{1}\]  
Here, \(\Delta I_{D}^{(S)}\) is the steady-state relative intensity change at the detector, \(\kappa=\pm 1\) keeps track of constructive versus destructive interference, \(\beta\) is the incoming power ratio of the destination versus the source beam, \(l\) is the interaction length, and \(\gamma\) is the coupling constant per unit length. \(\kappa\) is governed by the crystal orientation and light polarization and is mirrored between the source and destination signal path. A detailed expression for \(\gamma\) in terms of material and experimental parameters can be found in literature [10].  
If all experimental conditions are fixed, the relative intensity modification due to photorefractive two-wave mixing \(\Delta I_{D}\) is directly proportional to \(\Delta n\), and two-wave mixing is suitable to probe relative modifications to the index grating amplitude.  
The grating diffraction signal \(\Delta I_{D}\) can be robustly measured by repeatedly triggering the write sequence and observing the intensity modification in time (Figure 6). Write sequences are triggered in an experimentally attractive manner by square wave modulating the phase of the source beam between 0 and \(\pi\). The equilibrium position of the grating will phase shift by \(\pi\). Momentarily, the diffracted signal will reverse between constructive and destructive interference until the new grating is formed. This yields up to double the signal modification, and no intermediate grating erase sequence is required.  
Figure 5: The photorefractive crossbar array supports all matrix operations for ANN inference and training via back propagation (Figure 2). None of these operations require direct access to the matrix coefficients. During training, the crossbar array can be operated as a black box once initialized. The coefficients are only read out once the error function has been minimized.  
The photorefractive grating forms via an exponential relaxation process (Figure 6) [10]. For \(0\leftrightarrow\pi\) square wave phase modulation of the source beam at a frequency much below the inverse photorefractive response time \(\tau^{-1}\), the relative intensity modification after a phase-flip is then given by  
\[\Delta I_{D}(t)=\Delta I_{D}^{(S)}\Big{(}1-2e^{-t/\tau}\Big{)}. \tag{2}\]  
A detailed expression for \(\tau\) can be found in literature [10].