-
Notifications
You must be signed in to change notification settings - Fork 0
/
Magnetic Field and Strain Functions
45 lines (37 loc) · 1.4 KB
/
Magnetic Field and Strain Functions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import pybinding as pb
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import minimize
from pybinding.constants import phi0
import inspect
from pybinding.repository import graphene
from math import pi
###Note that these are credited to the tutorial from Pybinding, with small edits to their triaxial code to make it uniaxial
def constant_magnetic_field(B):
@pb.hopping_energy_modifier
def function(energy, x1, y1, x2, y2):
# the midpoint between two sites
y = 0.5 * (y1 + y2)
# scale from nanometers to meters
y *= 1e-9
# vector potential along the x-axis
A_x = B * y
# integral of (A * dl) from position 1 to position 2
peierls = A_x * (x1 - x2)
# scale from nanometers to meters (because of x1 and x2)
peierls *= 1e-9
# the Peierls substitution
return energy * np.exp(1j * 2*pi/phi0 * peierls)
return function
def uniaxial_strain(c, beta=3.37):
"""Produce both the displacement and hopping energy modifier"""
@pb.site_position_modifier
def displacement(x, y, z):
uy = c * y**2
return x, y + uy, z
@pb.hopping_energy_modifier
def strained_hopping(energy, x1, y1, z1, x2, y2, z2):
l = np.sqrt((x1-x2)**2 + (y1-y2)**2 + (z1-z2)**2)
w = l / graphene.a_cc - 1
return energy * np.exp(-beta*w)
return displacement, strained_hopping