SaashaJoshi / piQture

piQture: A quantum machine learning library for image processing.
https://saashajoshi.github.io/piQture/
Apache License 2.0
15 stars 7 forks source link

Implement Image Representation algorithms #31

Open SaashaJoshi opened 7 months ago

SaashaJoshi commented 7 months ago

The pipeline currently has 2 image representation algorithms:

  1. FRQI (2010)
  2. NEQR (2013)

Important QIR methods that need to be added:

SaashaJoshi commented 6 months ago

Do INEQR and GQIR require different implementations?

INEQR represents images of 2^n1 x 2^n2 dimensions, whereas, GQIR represents images of arbitrary dimensions H x W. According to this, INEQR could very much be a subset of GQIR.

SaashaJoshi commented 6 months ago

Answer: Yes, with minor modifications, there is a need for different implementations for INEQR and GQIR.

GQIR needs to modify the pixel_vals matrix to include dummy or None values for the redundancy pixels. For example, if the image is of size 1x3, a total of 2 + 4 = 3 qubits will be required to represent the image on the quantum circuit. However, the pixel_vals matrix should be transformed from something like this [[1, 2, 3]] to something like this [[1, 2, 3, None] [None, None, None, None]].

Screenshot 2024-01-05 at 4 24 15 PM

Image taken from:

N. Jiang, J. Wang, and Y. Mu, “Quantum image scaling up based on nearest-neighbor interpolation with integer scaling ratio,” Quantum Information Processing, vol. 14, no. 11, pp. 4001–4026, Aug. 2015, doi: https://doi.org/10.1007/s11128-015-1099-5