绘制一维bloch波函数

时间:2016-09-21 08:26:28

标签: python arrays function python-3.x

我是量子物理和编码的新手,所以我很感激我的代码提供了一些帮助。我试图在一维中绘制一个Bloch波函数,其中c-常数为c(-1)=0.5, c(0)=1 and c(1)=0.5,我将c值定义为数组。但我不确定这是最好的方法。布洛赫波函数应经过0-10 (Å)的x值。

我在Python中编码。我无法理解如何编写代码,希望我的函数能够通过c(-1)=0.5, c(0)=1, c(1)=0.5 for every point in x=[0,10]

我非常感谢我对代码的一些反馈:

import numpy as np
from matplotlib import peplos as pl
from matplotlib import animation
import math 

#Define constants 
N=1 
n=1
a=2
L=N*n*a
k=( 2 * math.pi ) / L
G = ( 2 * math.pi * n ) / a
x = np.array([ 0 , 10 ])

#Defining the c-values 
c = np.array([0.5,1,0.5])

#Defining the function 
def psi(x):
    return c*(np.exp((1j*(k+G)*x)))

for x in range: 
    for c in range: 
        y=psi(x) 

pl.plot(x,y) 
pl.show()

0 个答案:

没有答案
相关问题