# How can a density matrix be prepared on a quantum register?

I am currently trying to implement the VQSE algorithm. There the biggest eigenvalues and their corresponding eigenvectors of a density matrix $$\rho$$ are computed.

In contrast to VQE, the matrix $$\rho$$ is not used in the cost function (as observable), but as the input for the circuit.

Lets say $$\rho$$ is in $$\mathbb{C}^{2^n \times 2^n}$$ so the eigenvectors are in $$\mathbb{C}^{2^n}$$. I need $$n$$ qubits to represent the eigenvectors. I could just interpret the density matrix 'flattened' as a $$\mathbb{C}^{{2^n}{2^n}} = \mathbb{C}^{2^{2n}}$$ vector. Then I could do something like amplitude encoding on $$2n$$ qubits to represent the matrix. But I am very certain that this is not the idea of the paper. There $$\rho$$ has to be encoded in $$n$$ qubits. I looked into density matrix purification but I do not know if/how I can compute that for an arbitrary density matrix where I don't know how the density matrix got composed.

Edit:

Is purification of the density matrix the right idea? But then how can that be done for an arbitrary density matrix? (Let $$\rho = \sum_i p_i \left|\psi_i\right\rangle\left\langle\psi_i\right|$$, I know the values of $$\rho$$ but not of $$\left|\psi_i\right\rangle$$ or $$p_i$$). Or is there another way to encode a density matrix of $$n$$ qubit states in an $$n$$ qubit quantum register?

• Hi and welcome to Quantu Computing SE. Could you please specify what is your question? Do you need validation of your ideas or are you looking for help how to implement VQSE? Jun 18 at 13:32
• The state of an n qubit quantum register is a density matrix of $n$ qubits.... I don't think you need any encoding here? Jun 18 at 18:58
• I agree that the density matrix describes a n qubit state. But how do i make use of that in practice (for example in qiskit)? Especially since i dont know the underlying pure states? If i knew the pure states i could run the 'actual' circuit on the different pure states and scale the result with the probability $p_i$ i assume? Jun 18 at 22:42