-
Notifications
You must be signed in to change notification settings - Fork 22
Additional operator integrals and selection of gauge origin #169
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
Additional operator integrals and selection of gauge origin #169
Conversation
…hecks for gauge origin dependent operators. Change the default selection of gauge origin for operator integrals to origin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_property
for 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_moments
were 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.py
andveloxchem.py
the selection of the gauge origin is possible for gauge-origin dependent operator integralspyscf.py
includes additional operator integrals (diamagnetic magnetizability, electric quadrupole (traced, traceless and velocity)Reference State
Testing:
properties_test.py
add gauge origin dependency (transition magnetic dipole moments and rotatory strengths) and test transition_quadrupole_momentsReferenceState_refdata_test.py
add nuclear quadrupolesbackends_crossref_test.py
add some crossref checks between pyscf and veloxchem to verify gauge origin selectionpyscf_test.py
andveloxchem_test.py
extend operators test to gauge origin dependent tests.ToDo:
dump_pyscf.py
: dump nuclear quadrupole moments)nabla
toelectric_dipole_velocity
inDataHfProvider.py
anddump_pyscf.py
when generating new testdata