I have to write the following equation [![enter image description here](https://i.stack.imgur.com/Ymg6a.png)](https://i.stack.imgur.com/Ymg6a.png)

I have prepared the MWE, but it is not aligning properly,

```
\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{mathtools, nccmath}
\usepackage{array}
\begin{document}
    \begin{equation}
        \begin{array}{rl}
            L_{Y_{1} X_{1}} L_{Y_{0} X_{0}}\left(\left|I_{1}\right\rangle\right) & =L_{Y_{1} X_{1}} L_{Y_{0} X_{0}}\left(\frac{1}{2^{n}} \sum_{y=0}^{2^{n}-1} \sum_{x=0}^{2^{n}-1}\left|P_{y x}\right\rangle\left|y^{\prime}\right\rangle\left|x^{\prime}\right\rangle\right)\\
            & =\frac{1}{2^{n}}(\sum_{y=0}^{2^{n}-1} \sum_{x=0}^{2^{n}-1}\left|P_{yx}\right\rangle\left|y^{\prime}\right\rangle\left|x^{\prime}\right\rangle+U_{Y X}\left(\left|P_{Y_{0} X_{0}}\right|\right)\left|Y_{0} X_{0}\right\rangle+U_{Y X}\left(\left|P_{Y_{1} X_{1}}\right\rangle\right)\left|Y_{1} X_{1}\right\rangle \\
            & =\frac{1}{2^{n}}(\begin{array}{c}
                \sum_{y=0}^{2^{n}-1} \sum_{x=0}^{2^{n}-1}\left|P_{y x}\right\rangle\left|y^{\prime}\right\rangle\left|x^{\prime}\right\rangle+\left|p_{Y_{0} X_{0}}^{2} p_{Y_{0} X_{0}}^{3^{\prime}} \cdots p_{Y_{0} X_{0}}^{0^{\prime}} p_{Y_{0} X_{0}}^{1^{\prime}}\right\rangle\left|Y_{0} X_{0}\right\rangle \\
                y x \neq Y_{0} X_{0}, Y_{1} X_{1}
            \end{array}\\
            \qquad+\left|p_{Y_{1} X_{1}}^{2^{\prime}} p_{Y_{1} X_{1}}^{3^{\prime}} \cdots p_{Y_{1} X_{1}}^{0^{\prime}} p_{Y_{1} X_{1}}^{1^{\prime}}\right\rangle\left|Y_{1} X_{1}\right\rangle
        \end{array})
    \end{equation}
\end{document}

```

Kindly help me.