User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
documentation [2015/05/12 10:14] mackedocumentation [2016/03/30 09:33] (current) macke
Line 2: Line 2:
 ====== Units ====== ====== Units ======
  
-The Maxwell equations are in principle scale-invariant. However the program is intended to run in the atomic range.+Maxwell'equations are scale-invariant. However the program is intended to run in the microscopic scale.
 To be consistent use for: To be consistent use for:
  
Line 14: Line 14:
 ==== Incidence light ==== ==== Incidence light ====
  
-''light.theta'' +''quad.light.SetthetaPhi(number, number)'' 
-    typedecimal number + 1. argumentangle theta in degrees 
- DescTheta angle of the incoming light in degrees+ 2. argument: angle phi in degrees 
 + return value: none 
 + Desc: Set the incoming light direction in spherical coordinates. The angle theta must be between 90° and 180°! Otherwise, the light doesn't hit the sample from the top.
  
-''light.phi'' +''quad.light.SetEnergy(number)'' 
-   type: decimal number + 1argument: energy in ev 
-   Desc: Phi angle of the incoming light in degrees + return valuenone
-    +
-''light.k'' +
-   type: Vec3 (only readable) +
-   Desc: The current wavevector of the incoming light +
-    +
-''light.energy'' +
- typedecimal number+
  Desc: Energy of incoming light in eV  Desc: Energy of incoming light in eV
-  + 
-''light.polarization (string)'' + 
- type: string +''quad.light.SetPolarization (string)'' 
- valid values+ 1. argument
  "S" : Sigma polarization (perpendicular to the scattering plane)  "S" : Sigma polarization (perpendicular to the scattering plane)
  "P" : Pi polarization (parallel to the scattering plane)  "P" : Pi polarization (parallel to the scattering plane)
Line 39: Line 34:
  Desc: Defines the polarization of the incoming light dependent in relation to the HK=0,0 scattering plane.   Desc: Defines the polarization of the incoming light dependent in relation to the HK=0,0 scattering plane. 
   
-''light.filter (string)'' +''quad.light.SetPolarization (string, number)'' 
- type: string + 1. argument 
- valid values+ "S" : Sigma polarization (perpendicular to the scattering plane) 
 + "P" : Pi polarization (parallel to the scattering plane) 
 + "L" : Left circular polarization 
 + "R" : Right circular polarization 
 + 2. argument: Defines index of outgoing beam to define the scattering plane 
 + Desc: Defines the polarization of the incoming light dependent on the defined scattering plane.  
 + 
 + 
 +''quad.light.GetKVector()'' 
 +   return value: Vec3 
 +   Desc: Returns the current wavevector of the incoming light 
 +    
 +  
 +''quad.light.Setfilter(string)'' 
 + 1. argument
  "N" : none polarization filter (default)  "N" : none polarization filter (default)
  "S" : Sigma polarization filter (perpendicular to the scattering plane)  "S" : Sigma polarization filter (perpendicular to the scattering plane)
Line 48: Line 57:
  "R" : Right circular polarization filter  "R" : Right circular polarization filter
  Desc: Defines the polarization filter of the outgoing light.  Desc: Defines the polarization filter of the outgoing light.
-  +
-''light.out''  +
- TODO+
        
 ==== Main Functions ==== ==== Main Functions ====
  
-''BuildScatterMatrix()'' +''quad.Scatter()'' 
-   return value: nothing + return value: nothing 
-   Desc: Calculates the scattering matrices for the whole layer structure. It depends on almost all parameters given earlier and executes the main routine.+ Desc: Calculates the scattering matrices for the whole layer structure. It depends on almost all parameters given earlier and executes the main routine.
  
 ==== Atom creation ==== ==== Atom creation ====
  
-''atom.NewScatteringFactorAtom(number, number)''+''quad.atom.NewScatteringFactorAtom(number, number)''
  1. argument: real part of scattering factor (f1)  1. argument: real part of scattering factor (f1)
  2. argument: imaginary part of scattering factor (f2)  2. argument: imaginary part of scattering factor (f2)
Line 66: Line 73:
  Desc: Generates a energy-independent atom type  Desc: Generates a energy-independent atom type
  
-''atom.NewAtom(string)''+''quad.atom.NewAtom(string)''
  1. argument: short element name like "Ti" for Titanium  1. argument: short element name like "Ti" for Titanium
  return value: atom type  return value: atom type
  Desc: tries to find name.ff in order to load the scattering factor files or uses the internal database.  Desc: tries to find name.ff in order to load the scattering factor files or uses the internal database.
   
-''atom.NewAtom(string, q)''+''quad.atom.NewAtom(string, q)''
  1. argument: short element name like "Ti" for Titanium  1. argument: short element name like "Ti" for Titanium
  2. argument: defines the scattering for a certain momentum transfer q [Unit: A^-1]  2. argument: defines the scattering for a certain momentum transfer q [Unit: A^-1]
Line 77: Line 84:
  Desc: tries to find name.ff in order to load the scattering factor files or uses the internal database.  Desc: tries to find name.ff in order to load the scattering factor files or uses the internal database.
  
-''atom.NewMagneticAtom(number, number, number, number, number, number)''+''quad.atom.NewMagneticAtom(number, number, number, number, number, number)''
  1. argument: real part of scattering factor (f1)  1. argument: real part of scattering factor (f1)
  2. argument: imagninary part of scattering factor (f2)  2. argument: imagninary part of scattering factor (f2)
Line 87: Line 94:
  Desc: Generates a energy-independent atom type with magnetic contributions  Desc: Generates a energy-independent atom type with magnetic contributions
  
-''atom.NewScatteringFactorFileAtom(string)''+''quad.atom.NewScatteringFactorFileAtom(string)''
  1. argument: filename of tabulated scattering factors   1. argument: filename of tabulated scattering factors
  return value: atom type  return value: atom type
  Desc: Generates a energy-dependent atom type  Desc: Generates a energy-dependent atom type
  
-''atom.NewScatteringTensorFileAtom(string)''+''quad.atom.NewScatteringTensorFileAtom(string)''
  1. argument: filename of tabulated scattering tensors  1. argument: filename of tabulated scattering tensors
  return value: atom type  return value: atom type
Line 100: Line 107:
  
  
-''rl.Set(vec2, vec2, Decimal number, Decimal number)''+''quad.rl.Set(vec2, vec2, Decimal number)''
    1. Argument: First unit cell vector in-plane    1. Argument: First unit cell vector in-plane
    2. Argument: Second unit cell vector in-plane    2. Argument: Second unit cell vector in-plane
-   3. Argument: unit cell length in z-direction. This is needed to define the l-value in the function SetThetaHKL+   3. Argument: unit cell length in z-direction. This argument is necessary to define the l-value in the function SetThetaHKL
    Desc: Sets the lattice parameters in 2D. Adds the mandatory reciprocal lattice vector (H,K)=(0,0)    Desc: Sets the lattice parameters in 2D. Adds the mandatory reciprocal lattice vector (H,K)=(0,0)
    return value: nothing    return value: nothing
  
-''rl.b1()'' +''quad.rl.b1()'' 
-''rl.b2()'' +''quad.rl.b2()'' 
-''rl.b3()''+''quad.rl.b3()''
    return value: Vec3    return value: Vec3
    Desc: Returns the three reciprocal lattice vectors.    Desc: Returns the three reciprocal lattice vectors.
  
-''rl.GetN()''+''quad.rl.GetN()''
    return value: integer    return value: integer
    Desc: return the number of reciprocal lattice vectors calculated.    Desc: return the number of reciprocal lattice vectors calculated.
  
-''rl.AddReciprocalLatticeVector(number, number)''+''quad.rl.AddReciprocalLatticeVector(number, number)''
    1. Argument: Miller indice H of the reciprocal lattice vector    1. Argument: Miller indice H of the reciprocal lattice vector
    2. Argument: Miller indice K of the reciprocal lattice vector    2. Argument: Miller indice K of the reciprocal lattice vector
Line 123: Line 130:
    Desc: Adds a reciprocal lattice vector HK to the list of vector, which have to be calculated    Desc: Adds a reciprocal lattice vector HK to the list of vector, which have to be calculated
  
-''rl.SetRadius(number)''+''quad.rl.SetRadius(number)''
    1. Argument: Radius in the reciprocal lattice space    1. Argument: Radius in the reciprocal lattice space
    return value: nothing    return value: nothing
Line 131: Line 138:
  
  
-''slabs.AddSlabs(number, number)''+''quad.slabs.AddSlabs(number, number)''
    1. Argument: number of slabs to create    1. Argument: number of slabs to create
    2. Argument: thickness of each slab    2. Argument: thickness of each slab
    return value: nothing    return value: nothing
  
-''slabs.AddAtom(number, atom type, Vec3)''+''quad.slabs.AddAtom(number, atom type, Vec3)''
    1. Argument: add to the slab with index i    1. Argument: add to the slab with index i
    2. Argument: the variable with the atom type    2. Argument: the variable with the atom type
Line 142: Line 149:
    return value: nothing    return value: nothing
  
-''slabs.SetStructure(string)''+''quad.slabs.SetStructure(string)''
    Desc: Describes the final film structure. These are basically comma seperated slab indices or variables defined in slabs.DefineCrystal    Desc: Describes the final film structure. These are basically comma seperated slab indices or variables defined in slabs.DefineCrystal
          Additionally it allows to place brackets and repetitions          Additionally it allows to place brackets and repetitions
Line 153: Line 160:
    return value: nothing    return value: nothing
        
-''slabs.CreateCrystal(string, string)''+''quad.slabs.CreateCrystal(string, string)''
    1. argument: Variable name of this structure. Allowed signs: 'a'-'z', 'A'-'Z', '_', and '0'-'9' if it is not the first sign    1. argument: Variable name of this structure. Allowed signs: 'a'-'z', 'A'-'Z', '_', and '0'-'9' if it is not the first sign
    2. argument: Crystal definition like in the function slabs.SetStructure    2. argument: Crystal definition like in the function slabs.SetStructure
Line 159: Line 166:
    Desc: Defines a seperate crystal which can be used in the function slabs.SetStructure    Desc: Defines a seperate crystal which can be used in the function slabs.SetStructure
  
-''slabs.CreateHom(string, string)''+''quad.slabs.CreateHom(string, string)''
    1. argument: Variable name of this structure. Allowed signs: 'a'-'z', 'A'-'Z', '_', and '0'-'9' if it is not the first sign    1. argument: Variable name of this structure. Allowed signs: 'a'-'z', 'A'-'Z', '_', and '0'-'9' if it is not the first sign
    2. argument: Crystal definition like in the function slabs.SetStructure    2. argument: Crystal definition like in the function slabs.SetStructure
Line 165: Line 172:
    Desc: Defines a slab of an unordered crystal. The crystal is reduced to a continuum with the correct optical constants    Desc: Defines a slab of an unordered crystal. The crystal is reduced to a continuum with the correct optical constants
  
-''slabs.CreateInterface(string, string, string, number, number)''+''quad.slabs.CreateInterface(string, string, string, number, number)''
    1. argument: Variable name of this structure. Allowed signs: 'a'-'z', 'A'-'Z', '_', and '0'-'9' if it is not the first sign    1. argument: Variable name of this structure. Allowed signs: 'a'-'z', 'A'-'Z', '_', and '0'-'9' if it is not the first sign
    2. argument: Crystal definition of the top crystal like in the function slabs.SetStructure    2. argument: Crystal definition of the top crystal like in the function slabs.SetStructure
Line 178: Line 185:
 ==== General Functions ==== ==== General Functions ====
  
-''PrintStats()''+''quad.PrintStatus()''
    return value: nothing    return value: nothing
  
-''GetRefl(number)''+''quad.GetReflectedIntensity(number)''
    return value: Decimal Number    return value: Decimal Number
  
-''GetTrans(number)''+''quad.GetTransmittedIntensity(number)''
    return value: Decimal Number    return value: Decimal Number
    
-''GetReflK(number)''+''quad.GetReflectedKVector(number)''
     return value: Vec3     return value: Vec3
    
-''GetTransK(number)''+''quad.GetTransmittedKVector(number)''
     return value: Vec3     return value: Vec3
  
-''SetThetaHKL(integer h, integer k, Decimal number l)''+''quad.SetThetaHKL(integer h, integer k, Decimal number l)''
   return value: integer (-1 if error)   return value: integer (-1 if error)
   Desc: Calculates the angle theta for a fixed phi angle and given hkl triple. Variable l can be non-integer. Returns the index of the reciprocal lattice vector.   Desc: Calculates the angle theta for a fixed phi angle and given hkl triple. Variable l can be non-integer. Returns the index of the reciprocal lattice vector.
  a negative number of l means transmission whereas a positive number means reflection. The calculated angle theta is automatically set in the variable light.theta  a negative number of l means transmission whereas a positive number means reflection. The calculated angle theta is automatically set in the variable light.theta
  
-''SetMultipleScattering(type)''+''quad.SetMultipleScattering(type)''
   return value: nothing   return value: nothing
   valid values:    valid values: 
Line 206: Line 213:
      MS.INTERATOMIC: Interlayer as well as interatomic multiple scattering is enabled (not supported yet)      MS.INTERATOMIC: Interlayer as well as interatomic multiple scattering is enabled (not supported yet)
  
-''SetNumericAccuracy(type)''  (not supported yet)+''quad.SetNumericAccuracy(type)''  (not supported yet)
   valid values:    valid values: 
      NUM.FLOAT: The decimals numbers are defined as 4 byte floating point numbers      NUM.FLOAT: The decimals numbers are defined as 4 byte floating point numbers
Line 213: Line 220:
      NUM.QUAD: The decimals numbers are defined as 16 byte floating point numbers      NUM.QUAD: The decimals numbers are defined as 16 byte floating point numbers
  
-''SetMatrixAccuracy(type)''+''quad.SetMatrixAccuracy(type)''
   valid values:   valid values:
      M.DIAGONAL: Neglect off-diagonal terms of the matrices. Very fast but leads to separate scattering channels.      M.DIAGONAL: Neglect off-diagonal terms of the matrices. Very fast but leads to separate scattering channels.
Line 223: Line 230:
  
      
-''queue.Add()''+''quad.queue.Add()''
     Desc: Add current light configuration to queue     Desc: Add current light configuration to queue
  
-''queue.Run()''+''quad.queue.Run()''
     Desc: Execute the current queue parallelized     Desc: Execute the current queue parallelized
  
-''queue.Activate(integer)''+''quad.queue.Activate(integer)''
     Variable1: Index in the queue beginning from zero     Variable1: Index in the queue beginning from zero
     Desc: Activates a result of the queue.     Desc: Activates a result of the queue.
  
-''queue.GetN()''+''quad.queue.GetN()''
     return value: Number of entries in the queue     return value: Number of entries in the queue
  
-''queue.Clear()''+''quad.queue.Clear()''
    Desc: Clears the queue (Bug: Memory is not freed)    Desc: Clears the queue (Bug: Memory is not freed)
  
 ==== Fitting functions ==== ==== Fitting functions ====
  
-''fit.AddVariable(number, number, number, number)''+''quad.fit.AddVariable(number, number, number, number)''
  1. argument: initial value for number  1. argument: initial value for number
  2. argument: stepsize of 1.arguement in first iteration . If unsure choose 0.1*initial_value. The value must not be zero!  2. argument: stepsize of 1.arguement in first iteration . If unsure choose 0.1*initial_value. The value must not be zero!
Line 247: Line 254:
  4. argument: upper boundary for variable  4. argument: upper boundary for variable
  
-''fit.SetErrorFunction(function)''+''quad.fit.SetErrorFunction(function)''
  1. argument: Lua function which should return an error  1. argument: Lua function which should return an error
  Desc: The function receives a list of parameters (array of numbers), and should return an error (number)  Desc: The function receives a list of parameters (array of numbers), and should return an error (number)
  
-''fit.Iterate(number)''+''quad.fit.Iterate(number)''
  1. argument: Number of simplex iterations to perform  1. argument: Number of simplex iterations to perform