dkriegner / xrayutilities

xrayutilities - a package with useful scripts for X-ray diffraction physicists
http://xrayutilities.sourceforge.io
GNU General Public License v2.0
83 stars 29 forks source link

enable naming of simulation materials #169

Closed dkriegner closed 1 year ago

dkriegner commented 1 year ago

partly addressing issue #140

naming of materials for simulations allows to give more meaning full names to repeated materials. this allows to more intuitively link the parameters of such layers in simulations.

Exemplary use:

import xrayutilities as xu
# load materials
GaAs_ = xu.materials.GaAs
AlAs_ = xu.materials.AlAs
AlGaAs80 = xu.materials.AlGaAs(0.20)

# define layers
sub = xu.simpack.Layer(GaAs_, float('inf'))
lay_AlGaAs80 = xu.simpack.Layer(AlGaAs80, 20000, relaxation=0., name="AlGaAs SL")
lay_GaAs = xu.simpack.Layer(GaAs_, 2000, relaxation=0., name="GaAs SL")
cap = xu.simpack.Layer(GaAs_, 3200, relaxation=0.0, name="GaAs cap")

# make superlattice structure
heterostructure = xu.simpack.PseudomorphicStack001(
    'Hetereostructure', sub + (lay_AlGaAs80 + lay_GaAs)*5 + cap)
print(heterostructure)

The corresponding output is then

Hetereostructure [
  Layer-GaAs (a: 5.6532, at0_Ga_4a_occupation: 1, at1_As_4c_occupation: 1, at0_Ga_4a_biso: 0, at1_As_4c_biso: 0, thickness: inf, ),
  Layer-AlGaAs_SL (a: 5.6532, at0_Al_4a_occupation: 0.8, at1_As_4c_occupation: 1, at2_Ga_4a_occupation: 0.2, at0_Al_4a_biso: 0, at1_As_4c_biso: 0, at2_Ga_4a_biso: 0, relaxation: 0, thickness: 20000, c: 5.6664, ),
  Layer-GaAs_SL (a: 5.6532, at0_Ga_4a_occupation: 1, at1_As_4c_occupation: 1, at0_Ga_4a_biso: 0, at1_As_4c_biso: 0, relaxation: 0, thickness: 2000, ),
  Layer-AlGaAs_SL_1 (a: 5.6532, at0_Al_4a_occupation: 0.8, at1_As_4c_occupation: 1, at2_Ga_4a_occupation: 0.2, at0_Al_4a_biso: 0, at1_As_4c_biso: 0, at2_Ga_4a_biso: 0, relaxation: 0, thickness: 20000, c: 5.6664, ),
  Layer-GaAs_SL_1 (a: 5.6532, at0_Ga_4a_occupation: 1, at1_As_4c_occupation: 1, at0_Ga_4a_biso: 0, at1_As_4c_biso: 0, relaxation: 0, thickness: 2000, ),
  Layer-AlGaAs_SL_2 (a: 5.6532, at0_Al_4a_occupation: 0.8, at1_As_4c_occupation: 1, at2_Ga_4a_occupation: 0.2, at0_Al_4a_biso: 0, at1_As_4c_biso: 0, at2_Ga_4a_biso: 0, relaxation: 0, thickness: 20000, c: 5.6664, ),
  Layer-GaAs_SL_2 (a: 5.6532, at0_Ga_4a_occupation: 1, at1_As_4c_occupation: 1, at0_Ga_4a_biso: 0, at1_As_4c_biso: 0, relaxation: 0, thickness: 2000, ),
  Layer-AlGaAs_SL_3 (a: 5.6532, at0_Al_4a_occupation: 0.8, at1_As_4c_occupation: 1, at2_Ga_4a_occupation: 0.2, at0_Al_4a_biso: 0, at1_As_4c_biso: 0, at2_Ga_4a_biso: 0, relaxation: 0, thickness: 20000, c: 5.6664, ),
  Layer-GaAs_SL_3 (a: 5.6532, at0_Ga_4a_occupation: 1, at1_As_4c_occupation: 1, at0_Ga_4a_biso: 0, at1_As_4c_biso: 0, relaxation: 0, thickness: 2000, ),
  Layer-AlGaAs_SL_4 (a: 5.6532, at0_Al_4a_occupation: 0.8, at1_As_4c_occupation: 1, at2_Ga_4a_occupation: 0.2, at0_Al_4a_biso: 0, at1_As_4c_biso: 0, at2_Ga_4a_biso: 0, relaxation: 0, thickness: 20000, c: 5.6664, ),
  Layer-GaAs_SL_4 (a: 5.6532, at0_Ga_4a_occupation: 1, at1_As_4c_occupation: 1, at0_Ga_4a_biso: 0, at1_As_4c_biso: 0, relaxation: 0, thickness: 2000, ),
  Layer-GaAs_cap (a: 5.6532, at0_Ga_4a_occupation: 1, at1_As_4c_occupation: 1, at0_Ga_4a_biso: 0, at1_As_4c_biso: 0, relaxation: 0, thickness: 3200, )
]