I am currently trying to implement the tutorial in pennylane
https://pennylane.ai/qml/demos/tutorial_vqls.html
for very complex example in 3 Qubit and cost function is very high in spite of adding multiple layers in Variational circuit. I have two questions.
Can you suggest the best way to choose variational Ansatz and do you think I should consider different optimizers or any other suggestion to reduce cost function?
My matrix which converts zero state to output b state is not a quantum native matrix and I need to decompose it so how can we implement a linear combination of matrices in penny lane as an addition? Naturally, if we add gates it will be multiplication in circuit.
Thank you in advance and your reply would help me a lot in my understanding and implementing my code
Edit 1
I am trying to solve the linear equation Ax = b and The algorithm am using is VQLS and am trying to implement it in google collab using penny lane library.
A matrix and its decompostion and output b state am considering 3 qubit hadamard gate as of now
Attached is Ansatz am using and am getting local cost function using optimizer (GradientDescentOptimizer) around 0.10 and if I increase more layers cost function started increasing so I need suggestions
Regarding which variational circuit to choose
(Not relevant to my problem) Do we have any existing function or code which decomposes any matrix into multiplication or sequence of unitary matrices (ex Pauli).
for example (3 qubit) U = Pauli X1.Pauli Y2.Pauli X0