-
Notifications
You must be signed in to change notification settings - Fork 208
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
QMolecule Design #148
Comments
With the updated description of this issue above, I propose to convert this issue into an Epic after everyone had time to review it. I will create separate implementation-oriented issues for the three mentioned subtasks which can then be assigned to sprints in order to gradually close this (then) Epic. I would like to stress the benefit of the proposed step-by-step implementation again, because it will allow us to start working on a prototype for the containers while working on #147 in parallel. If we get towards the end of #147 before reaching the third proposed subtask of this issue we will also have gained a better overview of the drivers themselves which will help in the discussion of step 3 once we get to it. |
As part of #173 we discussed the possibility to further split
As such, renaming |
Disclaimer: All of the following also applies to the
VibrationalStructureProblem
andWatsonHamiltonian
. However, due to my personal expertise I will give examples almost exclusively in the electronic-framework.The
QMolecule
object has (and most likely will) remain unchanged for the past releases except for a few hot-patch additions of some attributes. It serves the purpose of a unified result object of allFermionicDriver
implementations.However, Qiskit Nature's remaining code base has matured a lot and has become a very modular-oriented framework, especially since the introduction of the
SecondQuantizedOp
in the last release.Right now, we can observe a lot of "utility"-like methods appearing in multiple locations of the code. For example:
This situation could be improved by a modular design of properties or observables which should be evaluated during the solution of a problem. The following UML shows an example:
With such modular objects, we could gather all of the property-specific code in a single, logical location from where it can be used by the rest of the stack. This includes:
Because such a change is rather intrusive into the existing framework, I propose to do the development in the following three steps.
1. Transformer-independent implementation
We start out with an implementation which is independent of the
qiskit_nature.transformers
module. This means, that the modular containers will be constructed out of the finally transformedQMolecule
before being passed on to the remaining stack.As an example, below is the adapted
ElectronicStructureProblem.second_q_ops
method:2. Investigate possible Transformer-refactoring
Once we have an initial implementation of the above working, we should investigate the possibility of refactoring the
qiskit_nature.transformers
module. The questions which need to be answered here include the following:ActiveSpaceTransformer
will need theParticleNumber
information besides the actual property to be transformed (i.e.ElectronicEnergy
orDipoleMoment
). In view of a future application such as [Feature] HF/DFT Embedding Schemes #26 it will also require theElectronicDensity
property when working with a non-diagonal density matrix.3. Investigation of
QMolecule
as the driver outputCurrently, the drivers output a
QMolecule
orWatsonHamiltonian
based on the driver type. While we do not initially plan on changing this, if we reach the end of the previous section, we will have gained more insight and the implementation of the properties may show that we could benefit from a modular driver output.I do not suggest that this is a necessary step to take, but we should at least re-evaluate this possibility once we get this far in the development.
The text was updated successfully, but these errors were encountered: