Beispiel #1
0
def effective_mass(p1, p2):

    if (p_space_grid == 'cartesian'):
        p_x = p1
        p_y = p2

        theta = af.atan(p_y / p_x)

    elif (p_space_grid == 'polar2D'):
        # In polar2D coordinates, p1 = radius and p2 = theta
        r = p1
        theta = p2
    else:
        raise NotImplementedError('Unsupported coordinate system in p_space')

    p_F = fermi_momentum_magnitude(theta)
    if (fermi_surface_shape == 'hexagon'):

        n = 6  # No. of side of polygon
        #mass = mass_particle * polygon(n, theta, rotation = np.pi/6)
        mass = (p_F / fermi_velocity) * polygon(n, theta, rotation=np.pi / 6)
        # Note : Rotation by pi/6 results in a hexagon with horizontal top & bottom edges

    elif (fermi_surface_shape == 'circle'):

        # For now, just return the free electron mass
        #mass = mass_particle
        mass = p_F / fermi_velocity

    return (mass)
Beispiel #2
0
def fermi_momentum_magnitude(theta):
    if (fermi_surface_shape == 'circle'):
        if (dispersion == 'linear'):
            p_f = initial_mu / fermi_velocity  # Fermi momentum
        elif (dispersion == 'quadratic'):
            p_f = 0.015  # numerical value set by mu/v_F, with mu = 0.015 and v_F = 1

    elif (fermi_surface_shape == 'hexagon'):
        n = 6  # No. of sides of polygon
        if (dispersion == 'linear'):
            p_f = (initial_mu / fermi_velocity) * polygon(
                n, theta, rotation=np.pi / 6)
        elif (dispersion == 'quadratic'):
            p_f = 0.015 * polygon(
                n, theta, rotation=np.pi / 6
            )  # numerical value set by mu/v_F, with mu = 0.015 and v_F = 1
        # Note : Rotation by pi/6 results in a hexagon with horizontal top & bottom edges
    else:
        raise NotImplementedError('Unsupported shape of fermi surface')
    return (p_f)
Beispiel #3
0
def fermi_momentum_magnitude(theta):
    if (fermi_surface_shape == 'circle'):
        p_f = initial_mu/fermi_velocity # Fermi momentum
    
    elif (fermi_surface_shape == 'hexagon'):
        n = 6 # No. of sides of polygon
        p_f = (initial_mu/fermi_velocity) * polygon(n, theta, rotation = np.pi/6)
        # Note : Rotation by pi/6 results in a hexagon with horizontal top & bottom edges
        #TODO : If cartesian coordinates are being used, convert to polar to calculate p_f
    else : 
        raise NotImplementedError('Unsupported shape of fermi surface')
    return(p_f)
        #f_at_desired_q = np.reshape((dist_func - \
        #    dist_func_background)[q1_position, q2_position, :],
        #                        [N_p2, N_p1]
        #                       )

        #print ("f at desired q : ", dist_func[q1_position, q2_position, :].shape)
        print("norm : ", norm_factor)

        radius = f.copy()
        theta = p2.copy()

        n = 6  # Number of sides of polygon
        r_bg = 5.

        weight = polygon(n, af.from_ndarray(theta),
                         rotation=np.pi / 6).to_ndarray()

        x = (radius + r_bg) * np.cos(theta) * weight
        y = (radius + r_bg) * np.sin(theta) * weight

        x_bg = r_bg * np.cos(theta) * weight
        y_bg = r_bg * np.sin(theta) * weight

        # To remove the discontinuity at -pi/pi
        x = np.insert(x, -1, x[0])
        y = np.insert(y, -1, y[0])

        print('p2 : ', p2.shape)
        #pl.plot(p2, f_at_desired_q)
        pl.plot(x, y, color='r', linestyle='-', lw=3)
        pl.plot(x_bg, y_bg, color='k', alpha=0.5, lw=3)
Beispiel #5
0
import arrayfire as af
import pylab as pl

import domain

from bolt.src.electronic_boltzmann.utils.polygon import polygon

p2_start = -np.pi
p2_end = np.pi
N_p2 = domain.N_p2
theta = \
    p2_start + (0.5 + np.arange(N_p2))*(p2_end - p2_start)/N_p2

theta = af.from_ndarray(theta)

hexa = polygon(6, theta, rotation=np.pi / 6)
hexa = hexa.to_ndarray()

#pl.polar(theta, hexa)

#pl.plot(theta, hexa * np.cos(theta))
#pl.plot(theta, hexa * np.sin(theta))

pl.gca().set_aspect(1)
pl.plot(hexa * np.cos(theta), hexa * np.sin(theta))

#p_hat_0_old = np.loadtxt("P_hat_0_old.txt")
#p_hat_1_old = np.loadtxt("P_hat_1_old.txt")

#p_hat_0 = np.loadtxt("P_hat_0.txt")
#p_hat_1 = np.loadtxt("P_hat_1.txt")