-
Notifications
You must be signed in to change notification settings - Fork 210
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
Towards a non-driver future #796
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a first step towards decoupling the BaseProblem and BaseDriver interfaces. Instead of injecting drivers and transformers into a problem, these become the output of our driver classes. In turn, transformers now take entire problem instances as input and return them as output. This is an intermediate step towards the final form of the problem classes and this commit is not working fully.
This moves the "main operators" into the new hamiltonians module and creates a base interface for these classes to follow.
- extracts a simple MoleculeInfo dataclass out of the original Molecule - moves UnitsType to DistanceType in the new units module (generalizing the concept of enumerating units)
This was
linked to
issues
Aug 18, 2022
woodsp-ibm
reviewed
Aug 29, 2022
qiskit_nature/second_q/transformers/active_space_transformer.py
Outdated
Show resolved
Hide resolved
qiskit_nature/second_q/transformers/active_space_transformer.py
Outdated
Show resolved
Hide resolved
qiskit_nature/second_q/transformers/active_space_transformer.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Steve Wood <[email protected]>
6aafce7
to
ca7e02e
Compare
woodsp-ibm
previously approved these changes
Sep 1, 2022
woodsp-ibm
previously approved these changes
Sep 1, 2022
071e9c9
to
e048860
Compare
woodsp-ibm
approved these changes
Sep 1, 2022
Anthony-Gandon
pushed a commit
to Anthony-Gandon/qiskit-nature
that referenced
this pull request
May 25, 2023
* WIP: problem refactoring This is a first step towards decoupling the BaseProblem and BaseDriver interfaces. Instead of injecting drivers and transformers into a problem, these become the output of our driver classes. In turn, transformers now take entire problem instances as input and return them as output. This is an intermediate step towards the final form of the problem classes and this commit is not working fully. * refactor: make BaseProblem class instantiable * refactor: integrate PropertiesContainer * refactor: populate second_q.hamiltonians This moves the "main operators" into the new hamiltonians module and creates a base interface for these classes to follow. * refactor: extract lattice constructor methods to Lattice * refactor: remove unneeded Property subclasses * fix: some linting * fix: html generation * fix: add missing hamiltonian.interpret call * WIP: migrate driver to QCSchema * refactor: molecule dataclass - extracts a simple MoleculeInfo dataclass out of the original Molecule - moves UnitsType to DistanceType in the new units module (generalizing the concept of enumerating units) * fix: spelling * fix: PySCFDriver * fix HDF5Driver-based tests * fix: GaussianDriver * fix linters * refactor transformer tests * fix: handle optionals in unittests * fix: GaussianDriver.from_matrix_file * fix: README example * fix: tutorials * fix: slow PySCF-dependent test * fix: revert minor change to PySCFDriver * test: fix InitialPoint unittests * docs: replace open TODOs in docstrings * add reno * refactor: use direct type hints for Hamiltonians * fix: default to ANGSTROM unit in MoleculeInfo * fix: do not copy LatticeModel.lattice * fix: generalize MoleculeInfo.coords type * fix: remove unused loggers * refactor: enforce keyword arguments in drivers * refactor: extract _QCSchemaData * refactor: some QCSchema methods * fix: update some docstrings Co-authored-by: Steve Wood <[email protected]> * refactor: update argument name in transformers * refactor: extract np.asarray into reshape utility Co-authored-by: Steve Wood <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This is the major PR which untangles the intertwined interfaces of
BaseProblem
,BaseDriver
andBaseTransformer
.There is no clean way to do this unfortunately, so this PR is rather massive...
Details and comments
I used this opportunity to also do some reshuffling to place the classes into their intended location. Most notably the population of the
qiskit_nature.second_q.hamiltonians
module.While this does add a bit of complexity to the PR, this is not a significant addition of the overall complexity and it allowed me to not have to introduce some dummy classes to ensure the API of the new
BaseProblem
looks correct.I do not recommend a commit-wise review of this PR due to its convoluted nature. The commits are not atomic and do not represent fully working states at each step of the way. Churning through everything as a bulk PR is advisable, albeit cumbersome.
The following is a non-exhaustive list of todos, before this PR can be merged:
From a technical perspective, this PR should already be ready to review, though.