Visualize the exchange
If we receive a new calculation from someone, usually it is easier to quickly look at some figures and aggregated data to figure out what is going on, than reading the system parameters from the simulation files. For this purpuse grogupy has a few tools to quickly and efficiently visualize the basic informations and print a summary of the calculation.
First import grogupy, which will import the most important classes, functions and variables in its namespace.
[1]:
import grogupy
################################################################################
# this is just for the html export of interactive figures, but it is not part of
# grogupy
import plotly
plotly.offline.init_notebook_mode()
################################################################################
/Users/danielpozsar/Documents/Documents_MacBook Air/studies/elte/phd/grogu/.venv/lib/python3.13/site-packages/grogupy/_tqdm.py:41: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
from tqdm.autonotebook import tqdm
The most useful format for post-processing is the .pkl format, because you can load the grogupy.Builder instance. Depending on the compression level you can do everything with it that is done in the Calculate magnetic parameters tutorial or just some basic plotting and convenient data accesing. Let’s suppose for now, that we got a maximally compressed Builder instance in a .pkl format. All the compression levels can be loaded the same way.
[2]:
system = grogupy.load(
"./../../../benchmarks/CrI3/CrI3_kset_21_21_1_eset_100_generalised-grogu.pkl"
)
system
[2]:
<grogupy.Builder npairs=114, numk=441, kset=[21 21 1], eset=100>
We can look at the representations of the instance, to get a feeling of the system.
[3]:
system.kspace
[3]:
<grogupy.Kspace kset=[21 21 1], NK=441>
[4]:
system.contour
[4]:
<grogupy.Contour emin=-18.2228951, emax=0.05, eset=100, esetp=10000>
[5]:
system.magnetic_entities
[5]:
<grogupy.MagneticEntityList length=2>
[6]:
system.pairs
[6]:
<grogupy.PairList length=114>
Or get a concise summary of the simulation.
[7]:
print(system)
--------------------------------------------------------------------------------
Metadata
grogupy version: 0.3.1
Architecture: CPU
SLURM job ID: Could not be determined.
Input file: /Users/danielpozsar/Documents/Documents_MacBook Air/studies/elte/phd/grogu/benchmarks/CrI3/CrI3.fdf
--------------------------------------------------------------------------------
Hamiltonian
Spin model: generalised-grogu
Spin mode: SPIN-ORBIT
Number of orbitals: 216
Unique ID: 7865166762118466085 6043752589833367243
--------------------------------------------------------------------------------
Solver
Number of threads in the parallel cluster: 1
Parallelization is over: K
Solver used for Greens function calculation: Parallel
Maximum number of Greens function samples per batch: 100
Low memory mode: True
--------------------------------------------------------------------------------
Cell [Ang]
7.00000000e+00 0.00000000e+00 0.00000000e+00
-3.50000000e+00 6.06217782e+00 0.00000000e+00
0.00000000e+00 0.00000000e+00 3.00000000e+01
--------------------------------------------------------------------------------
Exchange field rotations
DFT axis: [0 0 1]
Quantization axis and perpendicular directions:
1.00000000e+00 0.00000000e+00 0.00000000e+00 -->
0.00000000e+00 0.00000000e+00 -1.00000000e+00
0.00000000e+00 1.00000000e+00 0.00000000e+00
0.00000000e+00 7.07106781e-01 -7.07106781e-01
0.00000000e+00 1.00000000e+00 0.00000000e+00 -->
1.00000000e+00 0.00000000e+00 0.00000000e+00
0.00000000e+00 0.00000000e+00 -1.00000000e+00
7.07106781e-01 0.00000000e+00 -7.07106781e-01
0.00000000e+00 0.00000000e+00 1.00000000e+00 -->
1.00000000e+00 0.00000000e+00 0.00000000e+00
0.00000000e+00 1.00000000e+00 0.00000000e+00
7.07106781e-01 7.07106781e-01 0.00000000e+00
--------------------------------------------------------------------------------
Kspace
Total number of k points: 441
K points in each directions: [21 21 1]
--------------------------------------------------------------------------------
Contour
Eset: 100
Esetp: 10000
Ebot: -18.2228951 # WARNING: This was automatically determined!
Etop: 0.05
--------------------------------------------------------------------------------
/Users/danielpozsar/Documents/Documents_MacBook Air/studies/elte/phd/grogu/.venv/lib/python3.13/site-packages/grogupy/physics/hamiltonian.py:276: UserWarning:
Property could not be calculated. This is only acceptable for loaded Hamiltonian!
/Users/danielpozsar/Documents/Documents_MacBook Air/studies/elte/phd/grogu/.venv/lib/python3.13/site-packages/grogupy/physics/hamiltonian.py:287: UserWarning:
Property could not be calculated. This is only acceptable for loaded Hamiltonian!
Let’s visualize the contour and the Brilloun zone sampling. First we have to import grogupy.viz for this.
[8]:
import grogupy.viz
system.contour.plot().show()
system.kspace.plot()
Let’s look at the atomic positions of the magnetic entities.
[9]:
system.plot_magnetic_entities()
If we have a large system with many magnetic entities it can be useful to see all the pairs connected to the magnetic entities. We can interactively toggle them on and off in the figure and rotate the structure to have a better look.
[10]:
system.plot_pairs()
Finally we can look at the Dzyaloshinskii-Moriya interaction.
[11]:
system.plot_DMI(rescale=10)
Or if we want to visualize multiple things at once we can add together the figures as they are standard plotly.graph_objs.Figure instances.
[12]:
system.plot_DMI().add_traces(system.plot_pairs(connect=True).data)