예제 #1
0
vp.ztitle = ""

bck = vp.load(datadir+"images/schrod.png", alpha=0.3).scale(0.0255).pos([0, -5, -0.1])
barrier = Line(list(zip(x, V * 15, [0] * len(x))), c="black", lw=2)

lines = []
for i in range(0, Nsteps):
    for j in range(500):
        Psi += d_dt(Psi) * dt  # integrate for a while before showing things
    A = np.real(Psi * np.conj(Psi)) * 1.5  # psi squared, probability(x)
    coords = list(zip(x, A, [0] * len(x)))
    Aline = Line(coords, c="db", lw=3)
    vp.show([Aline, barrier, bck])
    lines.append([Aline, A])  # store objects

# now show the same lines along z representing time
vp.clear()
vp.camera.Elevation(20)
vp.camera.Azimuth(20)
bck.alpha(1)

for i in range(Nsteps):
    p = [0, 0, size * i / Nsteps]  # shift along z
    l, a = lines[i]
    # l.pointColors(a, cmap='rainbow')
    l.pointColors(-a, cmap="gist_earth")  # inverted gist_earth
    vp.add([l.pos(p), barrier.clone().alpha(0.3).pos(p)])
    vp.show()

vp.show(interactive=1)
예제 #2
0
bck = vp.load(datadir + "images/schrod.png",
              alpha=0.3).scale(0.0255).pos([0, -5, -0.1])
barrier = Line(list(zip(x, V * 15, [0] * len(x))), c="black", lw=2)

lines = []
for i in range(0, Nsteps):
    for j in range(500):
        Psi += d_dt(Psi) * dt  # integrate for a while before showing things
    A = np.real(Psi * np.conj(Psi)) * 1.5  # psi squared, probability(x)
    coords = list(zip(x, A, [0] * len(x)))
    Aline = Line(coords, c="db", lw=3)
    vp.show([Aline, barrier, bck])
    lines.append([Aline, A])  # store objects

# now show the same lines along z representing time
vp.actors = []
vp.camera.Elevation(20)
vp.camera.Azimuth(20)
bck.alpha(1)

for i in range(Nsteps):
    p = [0, 0, size * i / Nsteps]  # shift along z
    l, a = lines[i]
    # l.pointColors(a, cmap='rainbow')
    l.pointColors(-a, cmap="gist_earth")  # inverted gist_earth
    vp += [l.pos(p), barrier.clone().alpha(0.3).pos(p)]
    vp.show()

vp.show(interactive=1)