Skip to content

Conversation

molar-volume
Copy link
Contributor

@molar-volume molar-volume commented Dec 21, 2020

resolves https://github.com/Qiskit/qiskit-aqua/issues/1466, resolves #5553

Summary

  1. params are required in convert method in GradientBased and HessianBased subclasses
  2. fix on handling params of type ParameterExpression

Copy link
Contributor

@Cryoris Cryoris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the addition! Could you add a test that checks that all methods allow a ParameterVector? That could be just something really simple with a length-1 parameter vector 🙂

molar-volume and others added 5 commits December 26, 2020 21:53
…Based subclasses

2. fix on handling params of type ParameterExpression
Co-authored-by: Julien Gacon <gaconju@gmail.com>
* passmanager callback removal

* unused-import

* reno
Co-authored-by: Kevin Krsulich <kevin.krsulich@ibm.com>
…turalGradient, QFI and Hessian

2) index method added to ParameterVector
3) handling of ParameterVector changed for Hessian to be consistent with list params
@molar-volume
Copy link
Contributor Author

molar-volume commented Dec 26, 2020

Thanks for the review @Cryoris.

I modified few existing tests, all gradient modules are tested also with ParameterVector now.

I did minor change in handling the ParameterVector in Hessian: params = ParameterVector('a', 2) is now equivalent to params = [(a, a), (a, b), (b, b)].

Copy link
Contributor

@Cryoris Cryoris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing we should address but otherwise LGTM 🙂

anedumla and others added 5 commits December 29, 2020 15:25
* general polynomial approximation

* release notes

* fix qubit re-allocation

* fix re-calling build

* Update qiskit/circuit/library/arithmetic/piecewise_chebyshev.py

Co-authored-by: Julien Gacon <gaconju@gmail.com>

* Update qiskit/circuit/library/arithmetic/piecewise_chebyshev.py

Co-authored-by: Julien Gacon <gaconju@gmail.com>

* Update qiskit/circuit/library/arithmetic/piecewise_chebyshev.py

Co-authored-by: Julien Gacon <gaconju@gmail.com>

* fix indentation lint error

* move tests to library module

* Add suggestions from code review

Co-authored-by: Julien Gacon <gaconju@gmail.com>
As reported on multiple occasions in Qiskit Aqua ([1], [2]), the
eigenvalues of the auxiliary operators are not correctly normalized when
the QASM backend is used.

This commit fixes this short-coming by applying the same normalization
to the VQE's eigenstate when obtained from a QASM backend (in which case
this is a dictionary) as done by the `CircuitSampler` in its
`sample_circuits` function.
The case of the statevector backend is unaffected by this change, as it
will return the eigenstate as a list.

A unittest is added which asserts this behavior.

[1]: https://github.com/Qiskit/qiskit-aqua/issues/1460
[2]: qiskit-community/qiskit-aqua#1467

Co-authored-by: Julien Gacon <gaconju@gmail.com>

Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve handling of params argument in Gradient.convert
5 participants