Skip to content

Commit 9b49dd9

Browse files
AnthonyLim23mantid-publisher
authored andcommitted
updated
1 parent 23260cd commit 9b49dd9

1 file changed

Lines changed: 34 additions & 34 deletions

File tree

muon/muesr/school/CoF2/run_example.py

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from muesr.core import Sample
77
from muesr.engines.clfc import find_largest_sphere
88
from muesr.i_o import load_cif
9-
from muesr.utilities import mago_add, show_structure
9+
from muesr.utilities import mago_add, show_structure
1010
import matplotlib.pyplot as P
1111

1212

@@ -30,44 +30,44 @@ def add_muon_points(smp):
3030

3131
#magnetic moment from ( DOI:10.1103/PhysRevB.87.121108) and (DOI:https://doi.org/10.1103/PhysRevB.30.186) and https://doi.org/10.1103/PhysRevB.69.014417\n",
3232
cof.new_mm()
33-
cof.mm.k=np.array([0.0,0.0,1.0])
34-
# according to CoF2.cif (setting with a,b equal, c shorter, type cif to check)
35-
# H-M P4_2/mnm group 136, six atoms in the cell, in this order
36-
# Co at 0.00000 0.00000 0.00000 (2b site)
37-
# the symmetry replica is generated at 0.5000 0.5000 0.5000
38-
# http://www.cryst.ehu.es/cgi-bin/cryst/programs/nph-normsets?&norgens=&gnum=136
39-
# F at 0.30600 0.30600 0.00000 (4f site)
33+
cof.mm.k=np.array([0.0,0.0,1.0])
34+
# according to CoF2.cif (setting with a,b equal, c shorter, type cif to check)
35+
# H-M P4_2/mnm group 136, six atoms in the cell, in this order
36+
# Co at 0.00000 0.00000 0.00000 (2b site)
37+
# the symmetry replica is generated at 0.5000 0.5000 0.5000
38+
# http://www.cryst.ehu.es/cgi-bin/cryst/programs/nph-normsets?&norgens=&gnum=136
39+
# F at 0.30600 0.30600 0.00000 (4f site)
4040
# the symmetry replicas are generated at 1--x 1-x 0, 0.5+x 0.5-x, 0.5, 0.5-x,0.5+x, 0.5
4141
cof.mm.fc= np.array([[0.0+0.j, 0.0+0.j, 2.6+0.j],[0.0+0.j, 0.0+0.j, -2.6+0.j],
4242
[0.0+0.j, 0.0+0.j, 0.0+0.j],[0.0+0.j, 0.0+0.j, 0.0+0.j],
4343
[0.0+0.j, 0.0+0.j, 0.0+0.j],[0.0+0.j, 0.0+0.j, 0.0+0.j] ])
4444

45-
#show_structure(cof,visualizationTool='V') # show_structure(cof,supercell=[1,1,2],visualizationTool='V')
45+
show_structure(cof,visualizationTool='V') # show_structure(cof,supercell=[1,1,2],visualizationTool='V')
4646
n=18
47-
48-
radius=find_largest_sphere(cof,[n,n,n])
49-
B_dip = np.linalg.norm(locfield(cof, 's', [n,n,n] ,radius)[0].D,axis=0)
50-
print('R = {:.1f}, B_dip = {:.4f} T'.format(radius,B_dip))
51-
npoints = 11
52-
n = np.logspace(0.53,2,npoints,dtype=int)
53-
k = -1
54-
B_dip = np.zeros(npoints)
55-
R = np.zeros(npoints)
56-
for m in n:
57-
k += 1
58-
radius=find_largest_sphere(cof,[m,m,m])
59-
r=locfield(cof, 's', [m, m, m] ,radius) #
60-
R[k] = radius
61-
B_dip[k] =np.linalg.norm(r[0].D,axis=0)
62-
fig,ax = P.subplots()
63-
ax.plot(R,B_dip,'bo',label='sum')
64-
ax.plot(R,R-R+0.265,'b--',label='exp')
65-
ax1 = ax.twinx()
66-
ax.set_xlabel('R')
67-
ax.set_ylabel(r'$B_d$ [T]')
68-
ax1.plot(R,n,'rd')
69-
ax1.set_ylabel('m (sites per cube edge)')
70-
ax.legend(loc=9)
71-
P.show()
47+
48+
radius=find_largest_sphere(cof,[n,n,n])
49+
B_dip = np.linalg.norm(locfield(cof, 's', [n,n,n] ,radius)[0].D,axis=0)
50+
print('R = {:.1f}, B_dip = {:.4f} T'.format(radius,B_dip))
51+
npoints = 11
52+
n = np.logspace(0.53,2,npoints,dtype=int)
53+
k = -1
54+
B_dip = np.zeros(npoints)
55+
R = np.zeros(npoints)
56+
for m in n:
57+
k += 1
58+
radius=find_largest_sphere(cof,[m,m,m])
59+
r=locfield(cof, 's', [m, m, m] ,radius) #
60+
R[k] = radius
61+
B_dip[k] =np.linalg.norm(r[0].D,axis=0)
62+
fig,ax = P.subplots()
63+
ax.plot(R,B_dip,'bo',label='sum')
64+
ax.plot(R,R-R+0.265,'b--',label='exp')
65+
ax1 = ax.twinx()
66+
ax.set_xlabel('R')
67+
ax.set_ylabel(r'$B_d$ [T]')
68+
ax1.plot(R,n,'rd')
69+
ax1.set_ylabel('m (sites per cube edge)')
70+
ax.legend(loc=9)
71+
P.show()
7272
#Experimental results at site 1, Octahedral site is 2650 Gauss from (DOI:https://doi.org/10.1103/PhysRevB.30.186)
7373

0 commit comments

Comments
 (0)