QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: jalmeida on December 14, 2023, 16:04

Title: Mulliken Charge for each optimization step
Post by: jalmeida on December 14, 2023, 16:04
Hello,

Please, is it possible calculate automatically the Mulliken charge for each optimization step in QuantumATK?





Title: Re: Mulliken Charge for each optimization step
Post by: AsifShah on December 19, 2023, 13:39
hi,
Yes but you will have to run some code or else you can extract each configuration from trajectory and calculate mulliken charge.

Btw why is that required? Some of the images might have high forces/stresses and might not be of use?
Are you trying to track how Mulliken charge changes with steps?
Title: Re: Mulliken Charge for each optimization step
Post by: Anders Blom on January 5, 2024, 21:26
I do agree with AsifShah though, that it seems to be of limited usefulness, but it can be done (not sure about "automatically" but you can use a hook function).

You basically just need a post_step_hook function and pass this as argument in OptimizeGeometry:

Code: python
def computeMulliken(step, config):
    m = MullikenPopulation(config)
    nlsave("some_file.hdf5", m)

opt_geo = OptimizeGeometry(
    configuration=configuration,
    max_forces=0.01*eV/Angstrom,
    ...
    post_step_hook = computeMulliken,
    ....
)
Title: Re: Mulliken Charge for each optimization step
Post by: jalmeida on January 16, 2024, 11:45
Yeah, I am trying to see how the Mulliken charge is changing with the steps and this could be important on my case.

Thank you all for the reply!
Title: Re: Mulliken Charge for each optimization step
Post by: AsifShah on January 16, 2024, 13:11
Dear Jalmeida,
While you know your research problem well than what I understand. However, I believe this won't be of any use as optimization depends on algorithm used. Instead, a more better approach would be to use AIMD for your system and then track Milliken charge for each step.

Best regards
Title: Re: Mulliken Charge for each optimization step
Post by: jalmeida on January 26, 2024, 14:10
Dear AsifShah,

It's good advice! I'm not going to use the variation itself, it's just to better understand what's going on with my system that it's difficult to maintain the correct magnetic moment when I optimize it. Thanks for your collaboration.

Best regards