GithubHelp home page GithubHelp logo

Comments (6)

dkriegner avatar dkriegner commented on June 11, 2024

How many periods/layers you have in your superlattice? Can you provide an example script and specify what "quite a while" means?

I need to think about the possibilities of parallelization, but I think it's not as easy as in PowderModel. It might be actually easier in this case to look into numexpr.

from xrayutilities.

VeryBitter avatar VeryBitter commented on June 11, 2024

Thanks for you very fast answer. 555 periods ! I know its a lot (and relaxation may occur). I will have look to numexpr.

from xrayutilities.

dkriegner avatar dkriegner commented on June 11, 2024

yes 555 is a lot and the main loop in DynamicalModel goes over the layers and this is one which I think can't be parallelized, but its execution (loop body) could likely be optimized (maybe by numexpr). Any pull requests/patches are certainly welcome.

from xrayutilities.

VeryBitter avatar VeryBitter commented on June 11, 2024

Hi Dominique
back to this topic. I found out that the Darwin model was much faster when dealing with large superlattices. Is it related to the fact that every single layer produced by the loop has its own fitting parameters in the dynamical model? Maybe a superlattice layer model could be implemented, so that the fitting parameters would remain the same for each identical layer of the loop. Not sure I am clear... sorry. And not sure I have the skills to code it... sorry.

from xrayutilities.

dkriegner avatar dkriegner commented on June 11, 2024

I don't know why Darwin model could be faster.
But I think linking the parameters in a superlattice is already possible by using lmfit features. Basically in the same way as you do in your new example. You have to basically set the parameter to be equal to a different one. In this way all equal layers in a super lattice can be made to be represented by one parameter

See

# same composition as AlGaAs80_1
fitmdyn.set_param_hint('AlAs_0_80_GaAs_0_20__1_c', vary=True,
expr='AlAs_0_80_GaAs_0_20__c')

Note:
It would maybe be good for this to be a bit more usable to give a way to during construction of a Layer define a specific name: A change for this is required in this method I guess:

def __init__(self, material, **kwargs):
"""
initialize a simulation material by specifiying its Material and
optional other properties
Parameters
----------
material : Material (Crystal, or Amorphous)
Material object containing optical/crystal properties of for the
simulation; a deepcopy is used internally.
kwargs : dict
optional properties of the material needed for the simulation
"""
self.name = utilities.makeNaturalName(material.name, check=True)
self.material = copy.deepcopy(material)
for kw in kwargs:
setattr(self, kw, kwargs[kw])

Currently the names of the layers are automatically generated from the underlaying materials name. An optional keyword argument in the mentioned function would likely be better and one can still fall back to using the materials name if nothing is specified.

from xrayutilities.

dkriegner avatar dkriegner commented on June 11, 2024

Currently the names of the layers are automatically generated from the underlaying materials name. An optional keyword argument in the mentioned function would likely be better and one can still fall back to using the materials name if nothing is specified.

#169 picks up this idea and implements it.

from xrayutilities.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.