Additional operator integrals and selection of gauge origin #169
Additional operator integrals and selection of gauge origin #169apapapostolou merged 52 commits intoadc-connect:masterfrom
Conversation
…hecks for gauge origin dependent operators. Change the default selection of gauge origin for operator integrals to origin.
maxscheurer
left a comment
There was a problem hiding this comment.
Thanks a lot! Some initial comments from a first quick look 😁
Can you please have a look at this, too, @apapapostolou @Drrehn?
… into tests_operators
|
The selection of the origin is now an argument of the respective property, i.e. state.reference_state.operators.magnetic_dipole('mass_center'). I changed the tests so that I can reproduce some reference data I previously generated. However, I think my tests and how I generated this reference data can still be improved. Thus, @apapapostolou , @Drrehn , @maxscheurer maybe we should talk about how I should generate reference data and how to change the tests? |
apapapostolou
left a comment
There was a problem hiding this comment.
As for the reference data, I think you should not regenerate all the reference data for each gauge origin but only have different operator integrals.
Concerning the new tests:I updated the test and in order to do that I also needed to generate new hf data with pyscf. You can find the modified file in my HeiBox: I needed to regenerate new adcc reference data, I changed the file The new reference files can be generated with the provided scripts. Should I add the updated reference data to the HeiBox as well? |
|
Probably the reference data (adcc ref, that is) need to be re-generated once #175 is merged because that affects the data as well. |
3b7733e to
08e2af4
Compare
| [product_trace(comp, tdm) for comp in mag_dipole_integrals] | ||
| for tdm in self.transition_dm | ||
| ]) | ||
| return g_origin_dep_trans_magdip_moment |
There was a problem hiding this comment.
I don't really like the idea to return callables just to make mark_excitation_property work. It also leads to (in my opinion) non-intuitive behavior for ExcitedStates.excitation_property_keys since getattr(ExcitedStates, key) may now also return a callable, while otherwise e.g. a numpy array is returned. For this reason you might also have to adjust the ExcitedStates.to_dataframe export - the only other part of the code except Excitation where ExcitedStates.excitation_property_keys is used.
Maybe it is also fine to not decorate the gauge dependent member functions with mark_excitation_propertyfor now and add them at a later point? I think we need to iterate over ExcitedStates and Excitation anyway for #168.
There was a problem hiding this comment.
I don't agree with that. I think it makes sense to return them as callables:
- It would be unintuitive to exclude them, since they are actually excitation properties as well, and
transition_magnetic_dipole_momentswere included before as well. - However, it will not work to return them as numpy arrays, since they are no longer a constant value, but depend on the choice of gauge origin.
Therefore, I don't want to simply exclude them. I think it would make more sense to adjust ExcitedStates.to_dataframe. It could also take a gauge_origin parameter. I also need to extend it so that it can handle two-dimensional operators as well, which are needed for transition_electric_quadrupole_moments for example.
2e22ab0 to
4794532
Compare
4794532 to
69fad82
Compare
apapapostolou
left a comment
There was a problem hiding this comment.
Everything looks good to me. I agree with @frieschneider and think that we can leave the gauge-dependent excitation properties as they are for now. If ExcitedStates and Excitation are changed in the future, we can reconsider this as well.
If @jonasleitner also gives his approval, I think this is ready to be merged.
Operator integrals:
pyscf.pyandveloxchem.pythe selection of the gauge origin is possible for gauge-origin dependent operator integralspyscf.pyincludes additional operator integrals (diamagnetic magnetizability, electric quadrupole (traced, traceless and velocity)Reference State
Testing:
properties_test.pyadd gauge origin dependency (transition magnetic dipole moments and rotatory strengths) and test transition_quadrupole_momentsReferenceState_refdata_test.pyadd nuclear quadrupolesbackends_crossref_test.pyadd some crossref checks between pyscf and veloxchem to verify gauge origin selectionpyscf_test.pyandveloxchem_test.pyextend operators test to gauge origin dependent tests.ToDo:
dump_pyscf.py: dump nuclear quadrupole moments)nablatoelectric_dipole_velocityinDataHfProvider.pyanddump_pyscf.pywhen generating new testdata