Author Topic: Gaussian function with graphene  (Read 6957 times)

0 Members and 1 Guest are viewing this topic.

Offline rruisan

  • Regular QuantumATK user
  • **
  • Posts: 21
  • Country: mx
  • Reputation: 0
    • View Profile
Gaussian function with graphene
« on: April 8, 2014, 17:11 »
Hello to all!

Anyone can guide me, how can I recreate the Gaussian function, where the graphene made ​​and let me know their Cartesian Coordinates. Thanks in advance!


Under the image of what I would like to build with graphene.

Offline Umberto Martinez

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 479
  • Country: dk
  • Reputation: 26
    • View Profile
Re: Gaussian function with graphene
« Reply #1 on: April 9, 2014, 09:28 »
Try build a large graphene sheet and use the Coordinate Tools -> Transform by Expression to change the x coordinates components (if the x direction is the one perpendicular to the graphene sheet) according to your function.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5411
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Gaussian function with graphene
« Reply #2 on: April 9, 2014, 15:34 »
That will however introduce a stretch of the structure if the amplitude of the Gaussian shape is large.

What you actually need to do is a bit complicated - you should do an inverse mapping of the x (and y) coordinate to the arc length along the Gaussian shape and renormalize the coordinate. This is to keep the total length of the graphene sheet fixed even when wrapped around the functional shape. So, you need to create the function x'(x) where x is the original coordinate and x' the new one, such that L(x')=x where L is the arc length along the Gaussian.

Then you have to do it for y too, of course. In the end, for each atom with original coordinate (x,y,z=0), find x' and y' using these relations, then compute z'=f(x',y') where f is the Gaussian function. The new coordinate of the atom will be (x',y',z').

Offline rruisan

  • Regular QuantumATK user
  • **
  • Posts: 21
  • Country: mx
  • Reputation: 0
    • View Profile
Re: Gaussian function with graphene
« Reply #3 on: April 9, 2014, 19:21 »
If I understood well, I have to generate the script for this. Is there some method to generate or manually, using the parameterization of the Gaussian function (something like e ^ {- {x ^ 2 + y ^ 2}}), can I put it in the script too and how they put it? thanks in advance!

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5411
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Gaussian function with graphene
« Reply #4 on: April 9, 2014, 21:06 »
Yes you have to write a script for it, based on the algorithm I outlined.

Offline rruisan

  • Regular QuantumATK user
  • **
  • Posts: 21
  • Country: mx
  • Reputation: 0
    • View Profile
Re: Gaussian function with graphene
« Reply #5 on: April 10, 2014, 19:55 »
Thanks for the prompt reply! is there any tutorial? explain to me how to do the script or algorithm of the function, for example to generate the Mobius strip of parameterized Môbius.py not see how to generate the structure. This type of script (Môbius.py) help me? create the role I want to play. Thanks in advance!

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5411
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Gaussian function with graphene
« Reply #6 on: April 11, 2014, 08:50 »
I would say the Möbius tutorials is the showcase for how you can build complicated structures yourself. There is however no need really to build it as a Custom Analyzer (in fact, you should not, as this component is being discontinued), all you need is a Python script that creates the relevant structure - by importing the algorithm I outlined above - and e.g. saves the resulting geometry in an NC file which then can be imported in the Builder etc for further manipulations.

Offline rruisan

  • Regular QuantumATK user
  • **
  • Posts: 21
  • Country: mx
  • Reputation: 0
    • View Profile
Re: Gaussian function with graphene
« Reply #7 on: August 12, 2014, 19:41 »
Good day, I'm still trying to do the Gaussian structure of graphene, I started doing this:

import numpy as np

def makeGaussian(size, fwhm = 3, center=None):
    """ Make a square gaussian kernel.
    size is the length of a side of the square
    fwhm is full-width-half-maximum, which
    can be thought of as an effective radius.
    """

    x = np.arange(0, size, 1, float)
    y = x[:,np.newaxis]

    if center is None:
        x0 = y0 = size // 2
    else:
        x0 = center[0]
        y0 = center[1]

    return np.exp(-4*np.log(2) * ((x-x0)**2 + (y-y0)**2) / fwhm**2)

 # find width of gaussian
    configuration = NanoSheet(n,m)
    lattice = configuration.bravaisLattice()

# now extract the information about the configuration
    lattice = configuration.bravaisLattice()
    elements = configuration.elements()
    cartesian_coordinates=configuration.cartesianCoordinates().inUnitsOf(Angstrom)

# gaussian parameters group
builder.newGroup('gaussian parameters')
builder.integer( 'n', 8, 'n', min=1, max=1000)
builder.integer( 'm', 0, 'm', min=0, max=1000)
   
to run it does not work, would appreciate if you can guide me or tell me the correct way you can get me.
« Last Edit: August 12, 2014, 19:47 by rruisan »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5411
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Gaussian function with graphene
« Reply #8 on: August 19, 2014, 22:46 »
The indentation is wrong.

Offline rruisan

  • Regular QuantumATK user
  • **
  • Posts: 21
  • Country: mx
  • Reputation: 0
    • View Profile
Re: Gaussian function with graphene
« Reply #9 on: August 22, 2014, 07:21 »
I can help to create the right, please? or can you tell me, if I can take some example put (TubeBuilder.py) and change the lines to get what I want!
Thanks in advance!
« Last Edit: August 22, 2014, 07:31 by rruisan »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5411
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Gaussian function with graphene
« Reply #10 on: August 22, 2014, 16:19 »
Unfortunately I think the task is quite complicated. In general, if you want to wrap a structure like graphene like this over a certain shape, you have to make sure the topology is correct. To take a simple example in 1D, if you want to put a string of equidistant (distance=a) beads along a sin(x) function, you have to ensure that the distance between the beads is correct (i.e. still equidistant) on the sin-curve, not on the x-axis. This means that to place the n-th bead (originally at x=n*a on the flat string), you have to compute the length of the string along the sin-function, find the corresponding x such that int(sin(t),0,x)=n*a, and put the bead in (t,sin(t)). That is, you have to solve the equation for t, for each n. That's is straightforward in this case because we can integrate the sin-function analytically, and more importantly there is an inverse function to the integral, arccos, so we can solve it more or less easily - but for a general shape this may not be true.

Now, in 2D, you have a similar problem for x and y separately (we can assume the problem is separable), and indeed the Gaussian function is integrable analytically - but solving the equation must be done numerically (as far as I can see).

Btw, the "Buckler" plugin I have presented elsewhere does NOT use this approach, it just shifts the graphene sheet in the Z direction. That's ok for small displacements, at least as long as you optimize the structure afterwards. But the kind of shape you indicate, the strain on the C-C bonds will be way too large, unless of course your Gaussian width is very large compared to the C-C bond length. In that case it's simpler - you can just compute Z(x,y) from the Gaussian and shift all coordinates, and that's the approach you have used.

I would strongly recommend not trying to make this as a Custom Builder, because this component is being retired soon, and we don't support it anymore. It would be a lot simpler to just write a regular Python script, compute the coordinates as you do already, and just save the structure in an NC file.

Note, however, that we can't really teach you programming here, so you should first take some basic courses in Python to understand the point about indentation for instance.

Offline rruisan

  • Regular QuantumATK user
  • **
  • Posts: 21
  • Country: mx
  • Reputation: 0
    • View Profile
Re: Gaussian function with graphene
« Reply #11 on: August 28, 2014, 23:15 »
Dear Anders,

thank you very much for the guidance, I'm trying to recreate the ripples of graphene pots which he called "Fun with Graphene" as it has the Gaussian shape, but not values ​​should take "Buckler" I have moved other values ​​but keep getting weird stuff . I would appreciate s can you tell me, how I should change the values​​?

Offline Umberto Martinez

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 479
  • Country: dk
  • Reputation: 26
    • View Profile
Re: Gaussian function with graphene
« Reply #12 on: August 29, 2014, 08:50 »
for the Buckler, simply import a graphene sheet from the plugin, repeat the structure, use some parameters like the ones from the attached screenshot for the Buckler plugin. What kind of weird results do you have?
Note the axes directions! use the Bulk Tools-> Swap axes if needed.

As for the gaussian shape to avoid using the custom builder you can still try to use the coordinate tools->transform by expression plugin.
play around with the various constants and you will get something similar as reported in the figure.
Not sure this is what you wanted.

Important, as reported by Anders below these are just simple approximations and do not consider the exact topology and parametrization.
Indeed, if you optimize this last gaussian shape the structure will relax to a flat sheet...
have fun!

Offline rruisan

  • Regular QuantumATK user
  • **
  • Posts: 21
  • Country: mx
  • Reputation: 0
    • View Profile
Re: Gaussian function with graphene
« Reply #13 on: August 29, 2014, 21:20 »
thank you very much for help, but I do not get even, I believe that I have enough experience using this excuse. Try playing the two images you put,
in the first image you place, when repeated'm not understanding to do this (as used?), do so and get this


In the second image you can, just try to do so, by making the nano sheet, use swap axes X to Y, then put what you show in the image (depending on z). I would appreciate if you can tell me more detail or if you can suggest me where I can see this in some video. Thanks in advance!.

Offline Umberto Martinez

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 479
  • Country: dk
  • Reputation: 26
    • View Profile
Re: Gaussian function with graphene
« Reply #14 on: September 1, 2014, 21:53 »
I do not understand the first problem. nothing happens when you use the Buckel plugin? please rotate the structure..

about the second part...I also don't get what you did.
try with the attached structure.
you suggested the formula used there...
« Last Edit: September 1, 2014, 22:02 by Umberto Martinez »