# How to derive a circuit from given equations?

I was reading a paper on Quantum Neural Networks where the authors discussed a new back propagation algorithm. They shared a schematic of the circuit. However, I am unable to understand how the proposed circuit can be derived from the equations derived. Can anybody shed some light?

The paper can be found here: https://arxiv.org/pdf/1905.10912.pdf

The following equations:

$$\vert\psi(x)\rangle = \prod_{j=1}^{2^N} x_j \vert j\rangle$$

The above is the encoding.

$$\begin{split} \hat{\mathcal{N}} \vert \psi\rangle = \, &e^{-i\hat{H}\delta t}\vert \psi \rangle \\ = &e^{-i\hat{\sum\limits_{j=1}^{2^N} w_j \Xi_j}\delta t}\vert\psi\rangle\\ =\, &\prod_{j=1}^{2^N} e^{ - iw_j \Xi_j \delta t} \vert \psi\rangle\\ =\, &e^{ - iw_1 \Xi_1 \delta t} * e^{ - iw_2 \Xi_2 \delta t} \dots e^{ - iw_k \Xi_k \delta t} \dots e^{ - iw_{2^N} \Xi_{2^N} \delta t}\vert \psi\rangle. \\ \end{split}$$

The above is the architecture where $$w_{j}$$ represents the $$i\,th$$ weight and the funny horizontal symbol is actually one of $$\{I, \sigma_{x}, \sigma_{y}, \sigma_{z}\}$$, the set of Identity and Pauli matrices, $$\delta t$$ is a small time interval under which the system is evolved, and $$\hat{H}$$ is the Hamiltonian of the system.

The authors go on to state each product term can be written as (example if the horizontal symbol was actually $$\sigma_{x}$$):

$$\begin{split} e^{ - i w \sigma_x \delta t} &= cos(w \delta t)I - i sin(w \delta t) \sigma_x \\ &= \left[\begin{smallmatrix} cos(w \delta t) &0 \\ 0 & cos(w \delta t) \end{smallmatrix}\right] + \left[\begin{smallmatrix} 0 &-i sin(w \delta t) \\ -i sin(w \delta t) & 0 \end{smallmatrix}\right] \\ &= \left[\begin{smallmatrix} cos(w \delta t) &-i sin(w \delta t) \\ -i sin(w \delta t) & cos(w \delta t) \end{smallmatrix}\right] \end{split}$$

They defined the loss function as below:

$$\begin{split} \mathcal{L} &= (\langle\psi\vert \hat{\mathcal{N}}^{\star} - \langle y\vert)*(\hat{\mathcal{N}}\vert\psi\rangle-\vert y\rangle)\\ &=\langle\psi\vert \hat{\mathcal{N}}^{\star} \hat{\mathcal{N}}\vert \psi\rangle - \langle y\vert\hat{\mathcal{N}}\vert\psi\rangle - \langle\psi\vert\hat{\mathcal{N}}^*\vert y\rangle+\langle y | y \rangle\\ &= 2 -\langle y\vert\hat{\mathcal{N}}\vert\psi\rangle - \langle\psi\vert\hat{\mathcal{N}}^*\vert y\rangle \end{split}$$

And the training involves the following equations:

$$\begin{split} \frac{\partial \mathcal{L}}{\partial w_k} &= -\langle y\vert\frac{\partial \hat{\mathcal{N}}}{\partial w_k}\vert\psi\rangle - \langle\psi\vert\frac{\partial \hat{\mathcal{N}}^*}{\partial w_k}\vert y\rangle; \\ \frac{\partial \hat{\mathcal{N}}}{\partial w_k} &= e^{ - i\alpha_1 \Xi_1 \delta t} * e^{ - i\alpha_2 \Xi_2 \delta t} \dots (-i \Xi_k \delta t) \,e^{ - i\alpha_k \Xi_k \delta t} \dots e^{ - i\alpha_n \Xi_n \delta t};\\ \frac{\partial \hat{\mathcal{N}}^*}{\partial w_k} &= e^{ i\alpha_1 \Xi_1 \delta t} * e^{ i\alpha_2 \Xi_2 \delta t} \dots (i \Xi_k \delta t) \,e^{ i\alpha_k \Xi_k \delta t} \dots e^{ i\alpha_n \Xi_n \delta t}. \end{split}$$

Finally, they came up with this schematic:

Can anybody please explain how the circuit is derived from the equations?

• Hi @Nimish Mishra! I replaced your screenshots with MathJax/original image. Just for you to know, you can have access to the LaTeX code used to create an article published on ArXiV by clicking on "Other formats" in the Download section, on the right of arxiv.org/abs/1905.10912. This works for most of the articles on ArXiV. The LaTeX code can be downloaded as a tar archive on arxiv.org/format/1905.10912. – Nelimee Jun 25 '19 at 11:17