# How to simulate the quantum measurement of a quantum state in Quantum Image

I'm trying to implement (simulate) the Novel Enhanced Quantum Representation (NEQR), which is one of the quantum image representation models, but i'm stuck in the measurement part. In other words i don't know how to retrieve the original image from the quantum state.

The image is represented by the following formula (this is the final form after preparation): $$\left| \psi \right\rangle = \frac{1}{2^n} \displaystyle\sum_{Y=0}^{2^n -1} \displaystyle\sum_{X=0}^{2^n-1} \left| f(Y,X) \right\rangle \left| YX \right\rangle$$

Now, assume that i have a 2 x 2 image and the color of each pixel is 2 bit only, the position -> color cobinations are as follow:

YX -> color
00 -> 11
01 -> 00
10 -> 01
11 -> 00


The image or the final state which is composed of two entangled qubit sequences (color and position) should be a 16 x 1 column vector indexed by binary representation from 0 to 15 (e.g. 0000, 0001, ... 1111) and the value of 0001 will be 1 because color 00 is located in position 01.

The measurement is as follow:

During image retrieval from the quantum image, every pixel should be recovered individually. The following operations have been devised to retrieve pixel from a $$2^n × 2^n$$ quantum image.

How to perform measurement on the quantum state to retrieve the original image. In other words how to construct the matrix that when i multiply it with the state i retrieve the original image, but how to do that according to Quantum Operations ?

Please help to to solve this issue or guide me to the correct path. I didn't add all equations because i don't know if that is legal so please look for them in the paper.