-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default bounds for UCC ansatz circuits #818
Comments
The problem here is that the UCC ansatz has no concept of parameter bounds, since the parameters in this ansatz can take arbitrary values. I do not know, whether returning Maybe we could expose the parameter bounds to the user such that they can tweak things to at least make the algorithm runnable. But I would be hesitant as this would be a very fragile approach which could potentially lead to very inaccurate results if misused by the end-user. |
I see the point and already feared that it would turn out like that... As far as I have insight into the UCC ansatz, the parameters are only part of rotation gates. So, one could use the knowledge that a rotation gate can only rotate around 2pi (footnotemark) leading to effective bounds of (-pi, pi). With that one could e.g. for a Ry(2*theta) gate in the circuit set the bounds to (-pi/2, pi/2) i.e. streching the parameter bounds so that they fit into the (-pi, pi) scheme. footnote: Of course the rotation gates can take arbitrary values but one can always map them back to the (-pi, pi) interval without loss of generality. Exposing the bounds to the end-user is in my opinion not a good approach. For this actually the functionality of specifying an initial point should be sufficient (and is less fragile). |
Sorry for the long delay on getting back to you. A partial reason for the delay is that I simply do not have an ideal answer to this problem. The scaling of the parameter bounds to fit within the If If you want to open a PR which adds these bounds to the classes in the |
The question now is whether As soon as this question is clarified, I'll gladly add some code to implement it and open a PR (though in the latter case it would be in qiskit terra code). |
I will raise this idea to the people for involved with the affected components of Qiskit Terra and get back to you 👍 |
See Qiskit/qiskit#9718 which I created recently that more broadly talks about an improvement to bounds |
The general direction of the broader issue linked by Steve above was that bounds should not be coupled to the ansatz. Thus, I am closing this issue here. This change has not been implemented yet but I believe that further discussion (and potentially PRs) are welcome at qiskit-community/qiskit-algorithms#57 |
What is the expected enhancement?
Bounds are required for many optimizers (all of the package scikit-quant as can be read on page 9 of their documentation and possibly some of the other optimizers).
Most of the ansatzes located in qiskit terra (EfficientSU2, ExcitationPreservation, ...) have default bounds for the parameters (-pi to pi). See e.g. method parameter_bounds of EfficientSU2.
The ansatzes in qiskit nature (UCC, ...) don't have these default bounds implemented. Thus, those VQE calculations fail as pointed out in this bug report.
So, I propose to add the
parameter_bounds
method also to the ansatzes is qiskit nature.I'll gladly help adding the code.
The text was updated successfully, but these errors were encountered: