Material

[1]:
import nexus as nx

mat_iron_oxide = nx.Material(id = "my material",
                                 composition = [["Fe", 2], ["O", 3]],
                                 density = 5.3)

print(mat_iron_oxide)
Material
  .id: my material
  .composition:  Fe 2.0  O 3.0
  .density (g/cm^3) Var.value = 5.3, .min = 0.0, .max = 23.0, .fit: False, .id:
  .isotope: none
  .abundance Var.value = 0.0, .min = 0.0, .max = 1.0, .fit: False, .id:
  .lamb_moessbauer Var.value = 0.0, .min = 0.0, .max = 1.0, .fit: False, .id:
    derived parameters:
    .total_number_density (1/m^3) = 9.993720850163132e+28
    .average_mole_mass (g/mole) = 31.9374
    .isotope_number_density (1/m^3) = 0.0
    number of hyperfine sites 0

[2]:
permalloy_wt_composition = [["Ni", 80], ["Fe", 20]]

permalloy_at_composition = nx.conversions.WtToAt([["Ni", 80], ["Fe", 20]])

print(permalloy_at_composition)
[['Ni', 0.7919215353166942], ['Fe', 0.20807846468330582]]
[3]:
Fe2O3_at = (['Fe', 2], ['O', 3])  # or (['Fe', 0.4], ['O', 0.6])

Fe2O3_wt = nx.conversions.AtToWt(Fe2O3_at)

print(Fe2O3_wt)
(['Fe', 0.6994307614270416], ['O', 0.3005692385729583])
[4]:
mat_iron_oxide = nx.Material.Template(nx.lib.material.Fe2O3)
[5]:
mat = nx.Material(id = "my material",
                  composition = [["Fe", 2],["O", 3]],
                  density = 5.3,
                  isotope = nx.lib.moessbauer.Fe57,  # load isotope from library
                  abundance  = 0.95,  # "Fe" in composition is made out of 95% of 57-Fe,
                  lamb_moessbauer = 0.793,
                  #hyperfine_sites = []  # list Hyperfine objects acting on the isotope
                  )

print(mat)
Material
  .id: my material
  .composition:  Fe 2.0  O 3.0
  .density (g/cm^3) Var.value = 5.3, .min = 0.0, .max = 23.0, .fit: False, .id:
  .isotope: 57-Fe
  .abundance Var.value = 0.95, .min = 0.0, .max = 1.0, .fit: False, .id:
  .lamb_moessbauer Var.value = 0.793, .min = 0.0, .max = 1.0, .fit: False, .id:
    derived parameters:
    .total_number_density (1/m^3) = 9.865724904114486e+28
    .average_mole_mass (g/mole) = 32.351749454
    .isotope_number_density (1/m^3) = 3.748975463563505e+28
    number of hyperfine sites 0

[6]:
# do not pass any values. In this case there is no isomer shift, no magnetic field and no quadrupole splitting.
# it will results in an unsplit line
site = nx.Hyperfine()

# apply to the material
mat.hyperfine_sites = [site]

print(mat)
Material
  .id: my material
  .composition:  Fe 2.0  O 3.0
  .density (g/cm^3) Var.value = 5.3, .min = 0.0, .max = 23.0, .fit: False, .id:
  .isotope: 57-Fe
  .abundance Var.value = 0.95, .min = 0.0, .max = 1.0, .fit: False, .id:
  .lamb_moessbauer Var.value = 0.793, .min = 0.0, .max = 1.0, .fit: False, .id:
    derived parameters:
    .total_number_density (1/m^3) = 9.865724904114486e+28
    .average_mole_mass (g/mole) = 32.351749454
    .isotope_number_density (1/m^3) = 3.748975463563505e+28
    number of hyperfine sites 1