Dear Shrushti,

From a tight binding point of view, once we have defined our lattice and shape, we need to care  about the hopping and on-site energy, not the positions. In your case and in order to parameterise the hopping in the strained region you need to know the position transforms. In fact, parameterizing the hopping is the most important task. In strained graphene, parameterising the hopping is somehow similar to adding a magnetic field in the system.

In your script you have written: syst=pos_transform((5,0),0.05,pi/2)

This is completely wrong and Kwant will not be able to recognize the system. Since you are recently discovering Kwant, I recommend you to go through Kwant FAQ: https://kwant-project.org/doc/dev/tutorial/faq

Back to your issue, I guess you are caring to see the strained shape. In this case, you need to use pos_transorm like:

kwant.plot(syst, pos_transform=lambda pos: pos_transform(pos,c=c,angle=angle),
```Just one more thing, donot forget to uncomment
hoppings = (((0, 0), a, b), ((0, 1), a, b), ((-1, 1), a, b))
syst[[kwant.builder.HoppingKind(*hopping) for hopping in hoppings]] = t
otherwise you will not be able to see the strained position.Finally, you need to focus on using the correct hopping
Best

Le jeu. 22 juil. 2021 à 09:48, Shrushti Tapar <shrushti.tapar07@gmail.com> a écrit :
I am new to Kwant, as per our previous discussion, here I am attaching my program, I have defined my strain region and function for uniaxial strain in armchair direction. Now I struggling with how to introduce this function in the program.  Please correct me if I have understood it wrongly, Firstly we have to define graphene, by using the position of lattice points we have to apply pos_transform in a specified region, which will use the values of x and y co-ordinate from lattice placement due to lattice structure. The next doubt is like, as I using uniaxial strain in Y direction, it will squeeze lattice in X direction. So, the unstrained lattice point also has to shift accordingly. Right now I am only focusing on position displacement and not hopping.
import numpy as np
import scipy.io as spio
from numpy import *
import scipy.linalg as la
import matplotlib as mpl
import sympy as sym
import kwant

#%%######################
# parameters
L=20                            # Length of device on both sides
W=5                            # Width of device
t=-2.7
pot=0.5
c=0.05
angle=pi/2
# lattice type
graphene = kwant.lattice.general([(1, 0), (sin(pi/6), cos(pi/6))],
[(0, 0), (0, 1 / sqrt(3))],
norbs=1)
a, b = graphene.sublattices
# scattering region
def rectangle(pos):
x, y = pos
return 0 <= x <= L and 0<= y <= W

# strain_pos
def pos_transform(pos,c,angle):
x,y= pos
if 5<x<10:
ux=(cos(angle)**2-0.165*sin(angle)**2)*c*x
uy=(sin(angle)**2-0.165*cos(angle)**2)*c*y
return x+ux,y+uy
else:
return x,y

syst = kwant.Builder()
syst[graphene.shape(rectangle, (0, 0))] = 0
syst=pos_transform((5,0),0.05,pi/2)
#hoppings = (((0, 0), a, b), ((0, 1), a, b), ((-1, 1), a, b))
#syst[[kwant.builder.HoppingKind(*hopping) for hopping in hoppings]] = t
kwant.plot(syst);

Regards,
shrushti

On Fri, Jul 16, 2021 at 2:38 AM Adel Belayadi <adelphys@gmail.com> wrote:
Dear Shrushti,
it is straightforward to deal with strained graphene.
In the region you want to make strain, just set the function which modifies the site position (this mainly depends on the amount and type of the strain). Second, once you have shifted the site position you need to shift the hopping as illustrated in the file provided by Mr. Antonio.
here you find a simple script about how to shift the site position in the case of uniaxial strain (adjusted to you case)
```def Triaxial_transform(pos, center, I):
""" I is a parameter that lets us to control the intensity of the strain"""
x, y = pos
cx, cy = center, center # the center of the strain
r=sqrt((x-cx)**2+(y-cy)**2)    if r<sigma:
ux = 2*I * x*y
uy = I * (x**2 - y**2)
return x + ux, y + uy
else:
return x, y```
Then use this position to set your hopping as illustrated in a previous discussion [Ref-1].

You have to be careful in case you are using a strain in the z axis since you will not be able to plot the current.  It is somehow tricky in this scenario.

I hop this will help
Best wishes

Le jeu. 15 juil. 2021 à 14:19, <shrushti.tapar07@gmail.com> a écrit :
I want to create the graphene strained superlattice-like structure, having uniaxial strain defined at the specified region. Please, someone can suggest to me how to define the strained region and interface between unstrained and strained graphene regions.