コード例 #1
0
ファイル: falloff_highT.py プロジェクト: drostie/invibro
    g('set yrange [0:%s]' % max(ys))
    g('set size 0.6,0.6')
    g.xlabel('E (meV)')
    g.ylabel('A (1/meV)')
    g.plot(
        Gnuplot.Data(xs, ref, **{'with': 'lines lt 2 lc rgbcolor "blue" lw 2'}),
        Gnuplot.Data(xs, ys, **{'with': 'lines lt 1 lc rgbcolor "red" lw 2'})
    )
    g.hardcopy(name, color=1, terminal='postscript')
    print("File printed to %s" % name)

kelvin = 8.6173423e-5 * 1000 # 1K in meV
n = 1
for k in (0.6, -0.3):
    xs = linspace(-0.6, k, 2000)
    energies = harmonic_energies(hf=0.5)
    T = 5 * 0.5
    print("calc %s" % n); n += 1
    t0 = datetime.utcnow()
    calc = {
        'leads': [
            invibro.Lead(0.0, T, 0.025, linear_coupling(0.5), 50000.0),
            invibro.Lead(0.0, T, 0.025, linear_coupling(0.5), 50000.0)
        ],
        'e_level': 0.0,
        'ph_energy': energies,
        'ph_state': thermal_dist(T, energies)
    }
    ref = lorentzian(xs, calc)
    ys = invibro.density_of_states(xs, calc)
    render(xs, ys, ref, '/tmp/falloff-highT_%s.ps' % k)
コード例 #2
0
ファイル: flensberg.py プロジェクト: drostie/invibro
    g = L ** 2
    def sgn(x):
        return -1 if x < 0 else 1
    def matrix(m, n, L):
        if m > n: 
            return matrix(n, m, -L)
        else:
            return (exp(-g) * g ** (n - m) * fact(m)/fact(n)) ** 0.5 * \
                laguerre(m, n - m, g) * sgn(L) ** (n - m)
    return lambda m, n: matrix(m, n, L)

w0 = 0.02 # eV
T = 0.0258520269 # 300K in eV
invibro.dim=8

energies = harmonic_energies(0.02)

q = invibro.mat_from_fn(displace(1.0))
qbar = q.T.conjugate()

rho_0 = invibro.mat_from_fn(thermal_dist(T, energies))
rho_0 /= rho_0.trace()
rho_1 = qbar.dot(rho_0).dot(q)

from datetime import datetime
import Gnuplot
def plot(xs, ys, name, first=False):
    g = Gnuplot.Gnuplot()
    g('set xrange [1.88:2.08]')
    g('set yrange [0:200]')
    g('set xtics 1.92,0.04,2.04')