I want to play with the following problem. Given a unitary $U$ with parameters $\theta$ I want to optimize these parameters to make $U$ match some target unitary $V$, i.e. to find $\operatorname{argmin}_{\theta}||U(\theta)-V||$. This is in spirit of the quantum compiling problem, but here I want to build the parametrized circuit on my own.
Ideally I want to
- Build unitary $U(\theta)$ as a parametrized quantum circuit. This means that I do not want to explicitly construct matrix representations of gates etc.
- Use some well-developed framework for machine learning to minimize the loss function.
I am most familiar with qiskit
and I can do (1) there rather easily using parmetrized circuits. However, I do not know if it is possible to convert a parametrized circuit into a matrix form so that it could be fed to automatic differentiation software.
If the problem is not easily solvable in qiskit
I am willing to consider any other software stack with the main requirement being the ease of use.