1   
 2   
 3   
 4   
 5   
 6   
 7   
 8   
 9   
10   
11   
12   
13   
14   
15   
16   
17   
18   
19   
20   
21   
22   
23  """Module for functions relating to the paramagnetic centre.""" 
24   
25   
26  from numpy.linalg import norm 
27   
28   
30      """Calculate the electron spin to nuclear spin unit vectors and distances. 
31   
32      This assumes that there is one paramagnetic centre per state of the system. 
33   
34   
35      @param atomic_pos:      The atomic positions in Angstrom.  The first index is the spins, the second is the structures, and the third is the atomic coordinates. 
36      @type atomic_pos:       numpy rank-3 array 
37      @param paramag_centre:  The paramagnetic centre position in Angstrom. 
38      @type paramag_centre:   numpy rank-2, Nx3 array 
39      @param unit_vector:     The structure to fill with the electron spin to nuclear spin unit vectors. 
40      @type unit_vector:      numpy rank-3 array 
41      @param r:               The structure to fill with the electron spin to nuclear spin distances. 
42      @type r:                numpy rank-2 array 
43      """ 
44   
45       
46      for i in range(len(atomic_pos)): 
47           
48          for c in range(len(atomic_pos[i])): 
49               
50              vect = atomic_pos[i, c] - paramag_centre[c] 
51   
52               
53              r[i, c] = norm(vect) 
54   
55               
56              unit_vector[i, c] = vect / r[i, c] 
57   
58               
59              r[i, c] = r[i, c] * 1e-10 
 60   
61   
63      """Calculate the electron spin to nuclear spin unit vectors and distances. 
64   
65      This assumes that there is only one paramagnetic centre for all states of the system. 
66   
67   
68      @param atomic_pos:      The atomic positions in Angstrom.  The first index is the spins, the second is the structures, and the third is the atomic coordinates. 
69      @type atomic_pos:       numpy rank-3 array 
70      @param paramag_centre:  The paramagnetic centre position in Angstrom. 
71      @type paramag_centre:   numpy rank-1, 3D array 
72      @param unit_vector:     The structure to fill with the electron spin to nuclear spin unit vectors. 
73      @type unit_vector:      numpy rank-3 array 
74      @param r:               The structure to fill with the electron spin to nuclear spin distances. 
75      @type r:                numpy rank-2 array 
76      """ 
77   
78       
79      for i in range(len(atomic_pos)): 
80           
81          for c in range(len(atomic_pos[i])): 
82               
83              vect = atomic_pos[i, c] - paramag_centre 
84   
85               
86              r[i, c] = norm(vect) 
87   
88               
89              unit_vector[i, c] = vect / r[i, c] 
90   
91               
92              r[i, c] = r[i, c] * 1e-10 
 93