1

I am completely new to the field of quantum computing and am working on a project involving image processing. I need to encode the pixels of an image into a quantum system using different methods such as amplitude, angle and Hamiltonian encoding and then decode the quantum state back into pixels at the end of the process from its respective encoding.

From what I can find online, the angle encoding of a single qubit (say $|\psi\rangle$) is:

$$|\psi\rangle =\cos(x/2) |0\rangle + \sin(x/2)|1\rangle\,.$$

I could not find any information for multiple qubits so the way I implemented my angle encoding for an $n$-qubit system (say $|\phi\rangle$) is:

$$ \begin{align} |\phi\rangle = \,\,\,\,&\cos(x_1 / 2)\cos(x_2 / 2)\cdots\cos(x_n / 2) |{00...0}\rangle\\ &+ \cos(x_1 / 2)\cos(x_2 / 2) \cdots\sin(x_n / 2)|{00...1}\rangle\\ &\quad\quad\quad\quad\quad\quad\quad\quad\quad\vdots \\&+ \sin(x_1 / 2)\sin(x_2 / 2)\cdots\sin(x_n / 2)|11...1\rangle\,. \end{align} $$

I brute forced all this and decided in order to decode it, you square the vector and add adjacent terms since the $\sin^2(x_n/2) + \cos^2(x_n/2)$ in the LSQB becomes 1 until you are left with 2 terms, $\sin^2(x_1)$ and $\cos^2(x_1)$. You can continue this process after finding $x_1$ to find the rest of the angles. The only issue is that having the terms squared in this way gets rid of the negative signs so you can only be certain this decoding works for angles between $0$ to $\pi/2$. I feel like I did the encoding wrong or there is some cleaner way to decode the information but I have not been able to find anything online. Any help would be appreciated.

FDGod
  • 3,000
  • 2
  • 7
  • 31

1 Answers1

1

A quantum state is just a unit vector in $\mathbb{C}^d$. That is, it is of the form $$ \sum_k \alpha_k |k\rangle $$ with $\sum_k |\alpha_k|^2 =1$. If we write $\alpha_k = r_k e^{i \theta_k}$ for $r_k, \theta_k \in \mathbb{R}$ then we can parameterize the $r_k$ using Hyperspherical coordinates and if you really want to you can turn the complex exponentials into sine and cosine too.

For efficiency's sake you can also assume without loss of generality that $\theta_0 = 0$ as global phase is not physical.

Rammus
  • 6,878
  • 1
  • 11
  • 32