Skip to content
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

Saving spin-configuration files is not implemented for Monte-Carlo simulation? #597

Open
gwwfromcs opened this issue Jun 4, 2021 · 5 comments

Comments

@gwwfromcs
Copy link

gwwfromcs commented Jun 4, 2021

I notice Monte Carlo simulation does not output spin-configurations files or energies.
After checking "spirit/core/src/engine/Method_MC.cpp", I notice Method_MC::Save_Current is not implemented.

void Method_MC::Save_Current(std::string starttime, int iteration, bool initial, bool final)
{
}

I think a quick solution is copying the code in "Method_LLG::Save_Current" to "Method_MC::Save_Current" (just replace LLG with MC)?

Thank you very much!

@gwwfromcs gwwfromcs changed the title Monte-Carlo simulation save configuration not implemented Saving spin-configuration files is not implemented for Monte-Carlo simulation? Jun 4, 2021
@GPMueller
Copy link
Member

You are right, that method should not be empty and should mostly look like the one for LLG, so it should be a small fix. Please feel free to create a pull request if you like.

One comment: I would generally recommend using the Python package for Monte Carlo, as it gives you the flexibility that MC-simulations typically need, as shown here https://github.com/spirit-code/spirit/blob/master/ui-python/mc.py

@gwwfromcs
Copy link
Author

You are right, that method should not be empty and should mostly look like the one for LLG, so it should be a small fix. Please feel free to create a pull request if you like.

One comment: I would generally recommend using the Python package for Monte Carlo, as it gives you the flexibility that MC-simulations typically need, as shown here https://github.com/spirit-code/spirit/blob/master/ui-python/mc.py

Thank you for your comment. That's very helpful.

@sukhitoteh
Copy link

You are right, that method should not be empty and should mostly look like the one for LLG, so it should be a small fix. Please feel free to create a pull request if you like.

One comment: I would generally recommend using the Python package for Monte Carlo, as it gives you the flexibility that MC-simulations typically need, as shown here https://github.com/spirit-code/spirit/blob/master/ui-python/mc.py

Thank you, the code is helpful. But how can I get the net magnetization by considering the magnetic moment of individual atom? I am now studying system with two species of different magnetic moment, the function quantities.get_magnetization only return magnetization as unit vector, thus unable to tell the actual magnetization.

@GPMueller
Copy link
Member

@sukhitoteh, you are right, the quantities.get_magnetization function is not correct in this case (see also #527). However, you can always calculate the magnetization yourself, for example by using system.get_spin_directions, scaling the vectors with the atoms' magnetizations and then averaging or whatever you want to do.

@sukhitoteh
Copy link

@sukhitoteh, you are right, the quantities.get_magnetization function is not correct in this case (see also #527). However, you can always calculate the magnetization yourself, for example by using system.get_spin_directions, scaling the vectors with the atoms' magnetizations and then averaging or whatever you want to do.

thanks, this solved my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants