qiskit-community / qiskit-nature

Qiskit Nature is an open-source, quantum computing, framework for solving quantum mechanical natural science problems.
https://qiskit-community.github.io/qiskit-nature/
Apache License 2.0
306 stars 207 forks source link

Switch from `qiskit.algorithms` to `qiskit_algorithms` #1252

Closed mrossinek closed 1 year ago

mrossinek commented 1 year ago

Summary

This replaces all usage of the deprecated qiskit.algorithms module with the new qiskit_algorithms one provided by the corresponding community project.

Closes #1250

Details and comments

Right now, this will still fail CI because I need to handle cases where isinstance checks are going to fail. I am using CI to tell me where this occurs. What remains to be done is:

mrossinek commented 1 year ago

I don't understand why mypy is failing here. Will need to dig into this tomorrow...

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 6186528393


Totals Coverage Status
Change from base Build 6161449500: 0.008%
Covered Lines: 8709
Relevant Lines: 10038

💛 - Coveralls
mrossinek commented 1 year ago

CI of commit c07c3e00c868be91c1e4a19036af7791f15aa36c has successfully passed. This indicates that, even though the qiskit_nature module has been fully switched over to use qiskit_algorithms, the deprecated module qiskit.algorithms is still supported (since the tests have not been switched over yet).

In the next commits, I will update the docs and tests to use the new qiskit_algorithms. We will not test the working support of qiskit.algorithms going forward.

mrossinek commented 1 year ago

I have addressed the previous comment and also updated all occurrences of algorithm_globals. See df0137c5c982682e0469f0840af61093ac3826b6 for more details on the latter.

woodsp-ibm commented 1 year ago

One other thing - this also uses qiskit.utils validation eg like this in places from qiskit.utils.validation import validate_min this should get changed to from qiskit_algorithms.utils.validation import validate_min as the validation.py file, originally done in Aqua for algorithms will be deprecated/removed from Qiskit. (Just two uses that I saw)