# Quantum-Inspired Neural Network Model of Optical Illusions
## 3 Quantum Oscillator Model of Perception of Ambiguous Figures  
We model the dynamics of perception of the Necker cube using a harmonic motion of an electron trapped in a parabolic potential well (Figure 6a). This model is inspired by the quantum mechanical approach to human cognition proposed in ref. [9] and it captures the complex pattern of perception of the Necker cube [14]. A classical mechanics counterpart of this model is a small ball that rolls back and forth inside a bowl. While the ball does not have enough energy to surmount or penetrate a physical barrier inside the bowl, the electron may pass through the barrier due to the quantum tunnelling effect (Figure 6a). We model the quantum tunnelling effect by solving the Schrodinger equation in a one-dimensional space [97],  
\[i\hbar\frac{\partial\psi(x,t)}{\partial t}=\left[-\frac{\hbar^{2}}{2m}\frac{ \partial^{2}}{\partial x^{2}}+V(x)\right]\psi(x,t)\,, \tag{3}\]  
where \(\psi(x,t)\) is a wave function, \(i\) is the imaginary unit, \(m\) is the mass of the electron, \(\hbar\) is [PERSON]'s constant and \(V(x)\) is the parabolic potential well profile. We numerically solve  
Figure 6: **(a)** An electron trapped in a parabolic well behaves as a harmonic oscillator and it can pass through a barrier due to the quantum tunnelling effect. The arrows indicate the direction of movement. **(b)** Illustrative example (numerical simulation) of quantum tunnelling through a barrier. The dashed line denotes an snapshot of the incident Gaussian pulse. The solid line denotes the snapshots of the portions of the pulse that are reflected from and transmitted through the barrier (the green line, right \(y\)-axis). The labels \(|0\rangle\) and \(|1\rangle\) correspond to the perceptual states of the Necker cube. The arrows indicate the direction of propagation of the pulses with respect to the barrier. Equation (3) using a finite-difference time-domain (FDTD) method [98] that represents the wave function as \(\psi(x,t)=\psi_{re}(x,t)+i\psi_{im}(x,t)\). We obtain  
\[\frac{\partial\psi_{re}(x,t)}{\partial t}=-\frac{\hbar}{2m}\
abla^{2}\psi_{im}(x,t)+\frac{1}{\hbar}V(x)\psi_{im}(x,t), \tag{4}\] \[\frac{\partial\psi_{im}(x,t)}{\partial t}=\frac{\hbar}{2m}\
abla^ {2}\psi_{re}(x,t)-\frac{1}{\hbar}V(x)\psi_{re}(x,t)\,.\]  
Representing coordinate \(x\) and time \(t\) as the vectors of discrete elements \(x_{k}=k\Delta x\) and \(t_{n}=n\Delta t\), respectively, where \(k\) and \(n\) are integer numbers, and applying the Courant stability criterion [98], we define  
\[\Delta t=\frac{1}{8}\frac{2m}{\hbar}(\Delta x)^{2}\,. \tag{5}\]  
Thus, a spatio-temporally discretised Equation (4) becomes  
\[ \begin{split}\psi_{re}^{n}(k)&=\psi_{re}^{n-1}(k)- \frac{1}{8}\Big{[}\psi_{im}^{n-1/2}(k+1)-2\psi_{im}^{n-1/2}(k)+\psi_{im}^{n-1 /2}(k-1)\Big{]}+\frac{\Delta t}{\hbar}V(k)\psi_{im}^{n-1/2}(k),\\ \psi_{im}^{n}(k)&=\psi_{im}^{n-1}(k)+\frac{1}{8} \Big{[}\psi_{re}^{n-1/2}(k+1)-2\psi_{re}^{n-1/2}(k)+\psi_{re}^{n-1/2}(k-1) \Big{]}-\frac{\Delta t}{\hbar}V(k)\psi_{re}^{n-1/2}(k)\,.\end{split}  \tag{6}\]  
We model the electron as a Gaussian energy wave packet:  
\[ \begin{split}\psi_{re}^{0}(k)&=\exp\left(-0.5 \left(\frac{k-k_{0}}{\sigma}\right)^{2}\right)\cos\left(\frac{2\pi(k-k_{0})}{ \lambda}\right),\\ \psi_{im}^{0}(k)&=\exp\left(-0.5\left(\frac{k-k_{0} }{\sigma}\right)^{2}\right)\sin\left(\frac{2\pi(k-k_{0})}{\lambda}\right), \end{split}  \tag{7}\]  
where \(\lambda\) is the wavelength, \(\sigma\) is the width of the Gaussian pulse and \(k_{0}\) is the spatial coordinate of origin of the pulse. The amplitudes of the wave functions are normalised as  
\[\int_{-\infty}^{\infty}\psi^{*}(x)\psi(x)\,dx=1\,. \tag{8}\]  
The probabilities of funding the electron in the \(|0\rangle\) and \(|1\rangle\) regions of the potential well are calculated as  
\[P_{|0\rangle} =\int_{-\infty}^{X_{centre}}\psi^{*}(x)\psi(x)\,dx, \tag{9}\] \[P_{|1\rangle} =\int_{x_{centre}}^{\infty}\psi^{*}(x)\psi(x)\,dx\,, \tag{10}\]  
where \(P_{|0\rangle}+P_{|1\rangle}=1\).