Computing Hilbert-Schmidt distance using quantum circuit

Say I have two density matrices, [[0.7, 0.2 + 0.1j], [0.2 - 0.1j, 0.3]] and [0.5, 0.5j], [-0.5j, 0.5]].

Can anyone please help me with on how to compute the Hilbert-Schmdit distance between these these two matrices using a quantum circuit? It is my understanding that it can be implemented using SWAP test. However, I am not sure how to initialize the quantum circuit whose states is represented by the above density matrix.

Hi @raven_of_asgard,

You can use PennyLane’s qml.HilbertSchmidt template! In the usage details of the documentation for this template you can learn how to compare two unitaries.

You can probably combine this with qml.QubitDensityMatrix if you want to create a circuit from a density matrix.

Please let me know if you have any questions about this!

1 Like

Thank you, @CatalinaAlbornoz. This is exactly what I was looking for.

1 Like