コード例 #1
0
ファイル: run_experiment.py プロジェクト: meznom/phd_thesis
def run_it(p):
    print('Running for parameters: {}'.format(p))

    s = None
    if p.model == 'QcaBond':
        s = qca.QcaBond()
    elif p.model == 'QcaFixedCharge':
        s = qca.QcaFixedCharge()
    elif p.model == 'QcaGrandCanonical':
        s = qca.QcaGrandCanonical()
    elif p.model == 'QcaIsing':
        s = qca.QcaIsing()
    s.V0 = p.V0
    s.mu = p.mu
    s.q = p.q
    s.T = 1
    s.l = qca.Wire(p.N, p.V1, p.boa, 1)
    s.init()
    s.run()
    Es = np.array(s.energies())
    Es.sort()
    Es = Es[:10000]  # throw away high energy states
    s.results['energies'] = Es

    return s
コード例 #2
0
ファイル: run_experiment.py プロジェクト: meznom/phd_thesis
def run_it(p):
    print('Running for parameters: {}'.format(p))

    global last_s
    global last_ps

    if last_ps[:-1] == p.ps[:-1]:
        print('Changed T only')
        s = last_s
        s.T = p.T
        s.run(changedTonly=True)
    else:
        s = None
        if p.model == 'QcaBond':
            s = qca.QcaBond()
        elif p.model == 'QcaFixedCharge':
            s = qca.QcaFixedCharge()
        elif p.model == 'QcaGrandCanonical':
            s = qca.QcaGrandCanonical()
        s.V0 = p.V0
        s.mu = 250
        s.l = qca.Wire(p.N, p.V1, p.boa, 1)
        s.T = p.T

        s.init()
        s.run()

    last_s = s
    last_ps = p.ps

    return s
コード例 #3
0
 def P_out_for_boa(self, boa):
     self.s = qca.QcaIsing()
     self.s.t = 1
     self.s.q = 0.5
     P_D = 1.0
     self.s.T = self.T
     self.s.l = qca.Wire(self.N, self.V1, boa, P_D)
     self.s.init()
     self.s.run()
     return self.s.results['P'][-1]
コード例 #4
0
def run_it(p):
    print('Running for parameters: {}'.format(p))
    s = None
    if p.model == 'QcaIsing':
        s = qca.QcaIsing()
    elif p.model == 'QcaBond':
        s = qca.QcaBond()
    s.q = 0.5
    s.t = 1
    s.T = p.T
    s.l = qca.Wire(p.N, p.V1, p.boa, p.P)
    s.init()
    s.run()
    return s
コード例 #5
0
def run_it(p):
    print('Running for parameters: {}'.format(p))

    s = None
    if p.model == 'QcaBond':
        s = qca.QcaBond()
    elif p.model == 'QcaFixedCharge':
        s = qca.QcaFixedCharge()
    elif p.model == 'QcaGrandCanonical':
        s = qca.QcaGrandCanonical()

    s.q = p.q
    s.V0 = 1E6
    s.mu = 0
    s.t = 1
    s.T = p.T
    N, V1 = 3, 40
    s.l = qca.Wire(N, V1, p.boa, p.P)

    s.init()
    s.run()

    return s