Hyperfine

[1]:
import nexus as nx

hyperfine = nx.Hyperfine(
      id = "example parameter",
      weight = 1,                  # relative weight of the site in the material
      isomer = -0.11,              # isomer shift in mm/s
      magnetic_field = 33,         # magnetic field in T
      magnetic_theta = 0,          # polar angle
      magnetic_phi = 45,           # azimuthal angle
      quadrupole = 0.8,            # quadrupole slitting in mm/s
      quadrupole_alpha = 90,       # ZYZ extrinsic Euler angle alpha
      quadrupole_beta = 45,        # ZYZ extrinsic Euler angle beta
      quadrupole_gamma = 0,        # ZYZ extrinsic Euler angle gamma
      quadrupole_asymmetry = 0.05, # Asymmetry parameter
      isomer_dist = None,
      magnetic_field_dist = None,
      magnetic_theta_dist = None,
      magnetic_phi_dist = None,
      quadrupole_dist = None,
      quadrupole_alpha_dist = None,
      quadrupole_beta_dist = None,
      quadrupole_gamma_dist = None,
      quadrupole_asymmetry_dist = None,
      isotropic = False)           # 3D distribution in mag and EFG

print(hyperfine)
Hyperfine .id: example parameter
  .weight =               1.0
  .isomer_shift =         -0.11          dist points: 1
  .magnetic_field =       33.0           dist points: 1
  .magnetic_theta =       0.0            dist points: 1
  .magnetic_phi =         45.0           dist points: 1
  .quadrupole =           0.8            dist points: 1
  .quadrupole_alpha =     90.0           dist points: 1
  .quadrupole_beta =      45.0           dist points: 1
  .quadrupole_gamma =     0.0            dist points: 1
  .quadrupole_asymmetry = 0.05           dist points: 1
  .isotropic =            False          3D distribution in mag and efg. Random mag or efg distributions are ignored.
  random magnetic distribution: none     dist points: 1
  random quadrupole distribution: none   dist points: 1
  total number of distribution points: 1

[2]:
# Nexus frame (sigma, pi, k)
# spherical (mag, polar, azimuthal)

# convert a magnetic field along pi direction to spherical coordinates
print(nx.MagVectorToSpherical(0, 33, 0))

# convert a magnetic field along k direction to Nexus frame
print(nx.MagSphericalToVector(33, 0, 0))
(33.0, 90.0, 90.0)
(0.0, 0.0, 33.0)
[3]:
# input vector in the nexus coordinate system [sigma,pi,k]
alpha, beta, gamma = nx.euler.VectorsToAngles([0,1,0])

print(alpha, beta, gamma)  # the return value of alpha is random here
2.024215767587424 1.5707963267948966 1.5707963267948966
[4]:
# input vector in the nexus coordinate system.
# vectors must be orthogonal, but do not have to be normalized
Vzz = [1,0,0]
Vxx = [0,0,1]
Vyy = [0,1,0]
alpha, beta, gamma = nx.euler.VectorsToAngles(Vzz, Vxx, Vyy)

print(alpha, beta, gamma)
0.0 1.5707963267948966 3.141592653589793