Closed Abdou137 closed 4 years ago
This has nothing to do with Spirit. Please familiarize yourself with the way Python imports work (as the error already tells you, you cannot use something you neither defined nor imported).
My tip: look at the usage of the simulation
submodule and use the quantities
submodule in the same way.
Dear Mr. MUELLER, Thank you very much , I fixed it I think.
But , there are moslty OVF files in the output , although I asked to get magnetization: How one gets the magnetisation in order to draw hysteresis loop of a lattice ? To get the hysteresis loop, I wanted to do the follwoing : give a value for the external magnetic field , then run simulation , then get the magnetisation repeat the previous steps for different values of the external field then plot the magnetisation vs the external magnetic field . not sure if this will work , and not sure if there is another more efficient way
By another issue: I am trying to run a python file example provided in the github "https://github.com/spirit-code/spirit/tree/master/ui-python " whose name is (main.py), but it gives the following error:
File "main.py", line 154, in
if one asked to get some quantities ( magnetization .......) for instance using: quantities.get_magnetization(p_state) where could one find these quantities in the output files ? I didn't find the magnetization
I will appreciate any kind of help with nice regards
Maybe you found these things on your own already, but in case not:
system.get_spin_directions
API method: https://spirit-docs.readthedocs.io/en/latest/core/docs/python-api/spirit.system.html#spirit.system.get_spin_directions - calculating the magnetization values from these arrays is of course trivial
Dear all, I want to extract the magnetisation from a simulation, it gives the following error :
spirit.quantities.get_magnetization(p_state, idx_image=-1, idx_chain=-1) NameError: name 'spirit' is not defined
The code I used was simple :
I didn't find where is the problem . thus I will appreciate any kind of help with nice regards