In [1]:
%install_ext https://raw.githubusercontent.com/rasbt/python_reference/master/ipython_magic/watermark.py
%load_ext watermark


Installed watermark.py. To use it, type:
  %load_ext watermark

In [2]:
import numpy as np
from numpy import linalg as LA
from numpy import array
from numpy import pi
import matplotlib.pyplot as plt
import sys
import math
from scipy.optimize import curve_fit
import pickle

if "/home/dominique/Code/PG/Source" not in sys.path:
    sys.path.append("/home/dominique/Code/PG/Source")

import phase_fluctuations as PF
from phase_fluctuations import TbModel, TbParams, SWaveModel, DWaveModel
from MCMC import MCMCDriver
import scipy.constants as cst
def K_to_meV(in_temp):
    return cst.physical_constants["Boltzmann constant in eV/K"][0] * in_temp * 1000.0
def meV_to_K(in_temp):
    return  in_temp / 1000.0 / cst.physical_constants["Boltzmann constant in eV/K"][0]
def func(x, a, b, c):
    return a * np.exp(-b * x) + c

In [3]:
%load_ext autoreload
%autoreload 2

In [4]:
%who
%matplotlib inline


DWaveModel	 K_to_meV	 LA	 MCMCDriver	 PF	 SWaveModel	 TbModel	 TbParams	 array	 
cst	 curve_fit	 func	 math	 meV_to_K	 np	 pi	 pickle	 plt	 
sys	 

In [5]:
%watermark -a "Dominique" -d -t -u -v -h -m -g


Dominique Last updated: 16/08/2014 23:42:23 

CPython 2.7.6
IPython 2.0.0

compiler   : GCC 4.8.2
system     : Linux
release    : 3.15.0-eudyptula-7f4dc02f04c8-00107-g76429f1-dirty
machine    : x86_64
processor  : x86_64
CPU cores  : 4
interpreter: 64bit
host name  : Everest
Git hash   : 0974bd6199200a9dd53abd9bafd65f194b6ddf58

We pick the following parameters:

  • hopping constant $ t= 250$ meV
  • $\Delta = 1.0 t$ so that $T_c^{MF} \simeq 0.5 t$, and so that $\xi_0 \simeq a_0$
  • $g = -0.25$, unitless, so as to match the article's formalism, not the thesis'
  • $J = \dfrac{0.1 t}{0.89}$ so as to set $T_{KT} = 0.1 t$.

This means that we have the following physical properties


In [13]:
Tc_mf = meV_to_K(0.5*250)
print r"$T_c^{MF} = $", Tc_mf, "K"
print r"$T_{KT} = $", Tc_mf/10.0, "K"


$T_c^{MF} = $ 1450.56491032 K
$T_{KT} = $ 145.056491032 K

d Wave

Instantiation


In [6]:
T_CST = 0.25
BCS_PARAMS = {"width":4, "chem_potential": 0.0,
                 "hopping_constant": T_CST, "J_constant":  0.1 * T_CST / 0.89,
                 "g_constant": 0.25, "delta": 1.0 * T_CST, "use_assaad": True,
                 "uniform_phase": True, "temperature": 100}
MY_DWAVE_MODEL = DWaveModel(BCS_PARAMS)

In [7]:
print MY_DWAVE_MODEL


Class: <class 'phase_fluctuations.DWaveModel'>
Seed: 1234567890
Uniform phase: True
Temperature: 100 K

Base class:
Class: <class 'phase_fluctuations.DWaveModel'>
broadening delta: 0.0025 eV
use Assad: True
is up to date: False

Lattice: 
Class: <class 'phase_fluctuations.PairingParams'>
J constant: 0.0280898876404 eV
U constant: -0.825 eV
g constant: 0.25 eV
delta: 0.25 eV

Base class:
Class: <class 'phase_fluctuations.PairingParams'>
Width: 4
Chemical potential: 0.0 eV
Hopping constant: 0.25 eV
Number of sites: 
16

Modification


In [8]:
BCS_PARAMS = {"width":20, "use_assaad": True,
              "uniform_phase": True,  "temperature": 1.75*145.0}
MY_DWAVE_MODEL.set_params(BCS_PARAMS)
print MY_DWAVE_MODEL
print "temp: ", K_to_meV(MY_DWAVE_MODEL.temperature), "meV"


Class: <class 'phase_fluctuations.DWaveModel'>
Seed: 1234567890
Uniform phase: True
Temperature: 253.75 K

Base class:
Class: <class 'phase_fluctuations.DWaveModel'>
broadening delta: 0.0025 eV
use Assad: True
is up to date: False

Lattice: 
Class: <class 'phase_fluctuations.PairingParams'>
J constant: 0.0280898876404 eV
U constant: -0.825 eV
g constant: 0.25 eV
delta: 0.25 eV

Base class:
Class: <class 'phase_fluctuations.PairingParams'>
Width: 20
Chemical potential: 0.0 eV
Hopping constant: 0.25 eV
Number of sites: 
400
temp:  21.866480965 meV

DOS Computation


In [9]:
dos_values = np.real(MY_DWAVE_MODEL.get_dos())

In [10]:
fig, ax = plt.subplots(figsize = (10, 8), dpi=100, frameon=False)

x_values = MY_DWAVE_MODEL.lattice.omega_mesh / T_CST
xmin = np.amin(x_values)
xmax = np.amax(x_values)

ax.set_xlim([xmin, xmax])
ax.set_xticks(np.linspace(int(xmin), int(xmax), 13,endpoint=True))

ax.plot(x_values, dos_values)


Out[10]:
[<matplotlib.lines.Line2D at 0x7fbe8c281f50>]

MC Driver

Instantiation


In [26]:
BCS_PARAMS = {"width":20, "use_assaad": True,
              "uniform_phase": False,  "temperature": 1.75*145.0}
MY_DWAVE_MODEL.set_params(BCS_PARAMS)
print MY_DWAVE_MODEL._uniform_phase


False

In [27]:
MC_Params = {"seed": 222315, "intervals": 100,
             "target_snapshots": 10, "observable_list":["correlation_length"]}
MY_DRIVER = MCMCDriver(MY_DWAVE_MODEL, MC_Params)

In [28]:
print MY_DRIVER.mc_object.xy_lattice


[[ 3.39102446  0.66094368  2.12416207  3.50687663  4.31329676  5.39766871
   4.38145403  0.96550716  0.21228603  3.14115601  1.60170723  5.2938466
   2.40917018  2.42280274  5.24557729  5.48785557  0.95131223  0.96615711
   0.23753281  0.73402897]
 [ 4.39125259  0.1334599   4.46427652  6.00126122  0.2818825   3.30329859
   4.17084772  5.56279676  5.31462077  5.05962243  2.03534908  1.32364682
   2.57920382  4.93181339  2.87890698  2.73574987  2.44145037  0.74583291
   0.85403059  5.39169769]
 [ 2.31655763  5.70170937  2.35557075  0.67411599  3.39533767  0.91312831
   2.52077707  3.74844801  4.03527437  6.22034144  4.09528796  5.14753727
   1.40757351  0.06058975  0.48723768  1.41913994  3.601852    3.78301957
   2.94117516  0.15470189]
 [ 2.83072214  6.18955018  1.12935869  1.63351328  0.96058156  2.66154413
   5.66706575  3.51864563  0.65818903  3.47229408  4.97033404  3.27367029
   3.91786177  2.33316431  2.84573812  3.67846566  3.88823727  5.27759065
   6.1702195   2.71561345]
 [ 1.54622221  4.8659848   6.1092899   1.78869896  2.76372626  5.56349591
   3.31075059  2.5834467   3.10415975  3.743024    4.38391461  5.02019003
   5.27010963  6.00304825  3.95828706  1.33186613  5.68881623  2.00816108
   4.63480822  3.43672765]
 [ 4.76522041  3.76358487  1.54287814  0.57029814  1.86510534  0.70637587
   5.91009302  0.88586661  2.30126504  5.52336523  3.77830285  1.55096496
   2.32156229  0.5917189   5.09045566  5.2293529   5.4043124   3.37917202
   2.01999772  0.13486023]
 [ 6.02972534  2.5261763   5.03239578  4.10250413  1.84393901  3.96484708
   1.36852097  5.55660252  2.06121626  5.01329111  5.18106716  1.13335104
   1.55924374  2.90634628  3.65229145  3.81886314  0.69830824  1.37433105
   5.86954752  0.76777389]
 [ 4.39550472  1.19540071  2.83213762  5.31411722  2.51381831  3.66280332
   4.24161175  3.5447747   4.50865242  1.03014269  1.2095827   1.20180498
   2.96621404  4.10239066  2.27927073  2.38431553  1.18805941  5.07681919
   3.40736428  2.09843435]
 [ 5.106992    5.64657389  5.83727182  1.37356337  1.72516445  1.97540453
   3.56547293  4.34308253  0.12616476  6.21879369  5.65634634  6.28179329
   1.59474259  1.99410043  5.2277704   3.09941204  2.24952106  0.50472666
   4.31980828  3.90753003]
 [ 4.41417266  3.93187295  2.97754572  4.52161593  0.8335803   2.30645605
   5.29420336  3.01204523  0.57320925  1.01195273  3.24826513  0.6154995
   0.84442166  4.87925674  3.53933377  3.5768896   6.27040177  2.30431064
   1.50541652  2.16824012]
 [ 1.42413863  2.9760069   4.00684146  5.34259121  3.67878715  3.17170406
   2.13067349  0.23768933  5.49314665  2.06175759  4.65325947  1.62368792
   0.89709804  1.70462992  2.08451875  1.88336294  4.05937358  4.32878382
   4.81023892  2.79050098]
 [ 4.80082795  1.52172772  2.8243492   1.98252114  4.57151374  3.64501286
   1.4069972   0.76405237  1.37234711  5.38125199  1.24527062  4.0471485
   5.93045881  4.19514372  0.85844928  3.33639604  0.69594879  1.20754988
   2.16697027  0.45881929]
 [ 0.99775549  0.07903409  0.47618862  3.87597844  1.60521431  4.58774109
   0.82198499  4.95249808  5.5925886   3.12098143  2.38995315  4.04270798
   4.74934854  1.87176259  5.08660254  4.50824138  0.77213583  5.10355273
   1.96650893  4.046652  ]
 [ 2.12290669  4.28357725  3.58856346  2.95295233  5.68078259  1.80439961
   0.89310095  4.06884407  4.09621572  1.12103948  4.77721253  5.26867786
   1.31247013  1.91761641  2.33960416  3.70540351  5.03835146  1.06074511
   4.99755699  3.19919496]
 [ 5.98228914  1.03407742  3.84525872  2.08176769  3.71360847  4.74911656
   2.8192504   1.46165769  4.88566633  1.84577569  2.15650754  1.59681232
   0.31676413  0.44001043  4.56420279  0.09951401  0.07471222  0.07733357
   5.20363862  0.81669964]
 [ 2.39599612  3.47373129  3.64484923  4.49700018  1.32016542  4.56400142
   6.13867947  4.37858834  2.90218602  1.4660641   5.82004331  5.83157469
   3.31881641  2.93392391  3.98724435  2.09401703  5.52885438  2.76303581
   2.26730252  3.59558917]
 [ 2.98226606  0.08383051  2.98130634  0.84208036  0.79470048  3.64686504
   5.98014663  2.29559977  0.75028101  1.13237773  5.69560337  1.00940044
   4.61452153  3.21571576  6.23816873  6.1126614   3.60638164  2.40908576
   2.22601253  6.05403062]
 [ 2.82598639  5.9165602   5.19051381  2.12050391  1.32537503  4.98091468
   3.82638124  1.68140821  2.55500693  4.31864768  0.67075316  5.96452577
   4.87532745  1.48862394  6.12019785  3.88907792  1.9014402   4.5384076
   3.24188509  1.95852591]
 [ 4.01170412  5.28163877  0.37976648  5.6404803   2.23562464  2.62646716
   2.05084564  5.74141588  5.25325928  1.70873628  2.14914162  4.29770967
   0.98482294  3.28393709  2.00276179  5.10665496  4.19216209  1.16031019
   1.22959895  0.21201189]
 [ 6.10460647  4.60706446  3.73108077  4.57911737  2.80606914  0.98317175
   1.72501803  4.80104415  1.7385494   0.35516193  0.58369133  1.10356874
   0.24529353  5.28461549  3.27191522  0.97235735  0.24464004  4.24532237
   1.38845973  2.02641305]]

Modification


In [31]:
MC_PARAMS = {"intervals": 100,
             "target_snapshots": 25}
MY_DRIVER.set_params(MC_PARAMS)
print MY_DWAVE_MODEL._uniform_phase


False

In [32]:
print MY_DRIVER
print MY_DRIVER.params


Class: <class 'MCMC.MCMCDriver'>
Seed: 222315
Intervals: 100
Target snapshots: 25
Observable list: ['correlation_length']

MC Object:
Class: <class 'phase_fluctuations.DWaveModel'>
Seed: 1234567890
Uniform phase: False
Temperature: 253.75 K

Base class:
Class: <class 'phase_fluctuations.DWaveModel'>
broadening delta: 0.0025 eV
use Assad: True
is up to date: False

Lattice: 
Class: <class 'phase_fluctuations.PairingParams'>
J constant: 0.0280898876404 eV
U constant: -0.825 eV
g constant: 0.25 eV
delta: 0.25 eV

Base class:
Class: <class 'phase_fluctuations.PairingParams'>
Width: 20
Chemical potential: 0.0 eV
Hopping constant: 0.25 eV
Number of sites: 
400

Results: None
{'intervals': 100, 'seed': 222315, 'target_snapshots': 25, 'observable_list': ['correlation_length']}

In [33]:
MY_DRIVER.mc_object.set_params({"temperature": 0.0000000000001 * 145.0})
MY_DRIVER.thermalize(20000)

In [50]:
MY_DRIVER.thermalize(1000000)
print MY_DRIVER.mc_object.xy_lattice


[[ 5.31444756  5.41213743  5.53221966  5.63291758  5.72036565  5.79965813
   5.85999559  5.92036298  5.96660596  6.01445649  6.01564201  6.00773327
   5.95507639  5.8471428   5.70275135  5.51656834  5.37670918  5.2651677
   5.22986294  5.24179552]
 [ 5.15929865  5.35165762  5.51218828  5.63710468  5.72773192  5.81150567
   5.90455129  5.96886072  6.03314071  6.0864353   6.11059183  6.10413953
   6.05304411  5.91738765  5.69251303  5.38268882  5.1358756   5.00555235
   4.96820174  5.03281416]
 [ 5.01903172  5.36192634  5.52159889  5.71525098  5.81190516  5.93171772
   5.98749418  6.06034729  6.13572263  6.20116638  6.25067001  6.26294191
   6.21738649  6.06824843  5.75461404  5.18662775  4.8017018   4.64718088
   4.64015435  4.75008826]
 [ 5.11169204  5.55035631  5.72980938  5.83164938  5.94111402  6.03086605
   6.09857746  6.18786217  6.27227467  0.076242    0.14488272  0.17746564
   0.19856006  0.11066319  6.08585996  4.90253415  4.28003619  4.14038233
   4.18609517  4.43573557]
 [ 5.36301895  5.85834965  6.0226282   6.10242519  6.14896253  6.20098189
   6.25369987  0.04366859  0.13680377  0.23335963  0.34707913  0.41971064
   0.52466512  0.67579022  1.05585355  2.36758971  3.09873272  3.40233678
   3.61500444  3.99897242]
 [ 0.98620677  0.49308194  0.24658221  0.12789171  0.08291458  0.08986964
   0.1126355   0.17798321  0.27088038  0.36744703  0.46580774  0.6111851
   0.74309612  1.00187178  1.40657917  2.04592351  2.52414438  2.7338411
   2.73483119  2.41302376]
 [ 1.30386606  0.89397686  0.57853068  0.39927309  0.28379651  0.23486575
   0.23958742  0.29563383  0.38573869  0.49226556  0.5996252   0.77284532
   0.92808012  1.13626874  1.43234508  1.81232067  2.13280468  2.27279742
   2.21931025  1.95655024]
 [ 1.32909296  1.00006858  0.74821999  0.56128727  0.41784204  0.35394457
   0.33907534  0.37795745  0.45634429  0.56479455  0.66699865  0.82449583
   0.98964582  1.16035351  1.38308039  1.62221636  1.82915337  1.91766972
   1.85241411  1.69659104]
 [ 1.23992439  1.02536786  0.80884468  0.6312697   0.49022235  0.41216274
   0.39294359  0.41584117  0.47634273  0.56698557  0.69193104  0.83251073
   0.96642745  1.14193083  1.31099977  1.45278494  1.58933184  1.61474566
   1.57865337  1.42312531]
 [ 1.10288088  0.94903927  0.77645088  0.62344048  0.51412224  0.43940847
   0.39941751  0.40923058  0.45004393  0.53595221  0.64077771  0.76995155
   0.88850361  1.03248584  1.18373331  1.25749878  1.36212264  1.39809184
   1.3422705   1.22575086]
 [ 0.95531317  0.82532248  0.68030385  0.57298415  0.47513736  0.4035529
   0.36127895  0.35619536  0.39096495  0.46140054  0.55572641  0.66066523
   0.79817884  0.93340684  1.04378561  1.08328449  1.16159917  1.16699565
   1.1345843   1.04535592]
 [ 0.79989596  0.68524644  0.56786359  0.46857571  0.38154733  0.31470935
   0.27535392  0.27106379  0.30114681  0.35586145  0.43764294  0.53791126
   0.65279699  0.75455357  0.84530913  0.92619247  0.94831054  0.95245346
   0.92158637  0.87106988]
 [ 0.6122382   0.53039679  0.43296673  0.33838969  0.25906851  0.19939142
   0.16898081  0.15977214  0.18977495  0.22485829  0.29105108  0.38882005
   0.48592231  0.5871603   0.65911539  0.707147    0.73239929  0.73605481
   0.71050234  0.68513639]
 [ 0.40688574  0.3391241   0.26544538  0.18770578  0.11989923  0.06882343
   0.04613213  0.05395684  0.07028299  0.09386693  0.15436601  0.22909277
   0.31770631  0.40023355  0.46318873  0.51407492  0.54177148  0.52151113
   0.51294612  0.46074377]
 [ 0.20601551  0.14447553  0.08248862  0.02556544  6.25068272  6.21817939
   6.20845643  6.20560856  6.22068332  6.27419143  0.02342028  0.09040182
   0.15940294  0.22562892  0.26591465  0.30432549  0.32672459  0.33114118
   0.30375939  0.24580147]
 [ 6.27697188  6.22388825  6.18175303  6.14869439  6.11079483  6.08398063
   6.08466865  6.09915113  6.09855859  6.15313966  6.19583756  6.23163475
   0.0119114   0.06362125  0.09526     0.11755897  0.12321943  0.10294353
   0.08123385  0.04041232]
 [ 6.06049597  6.0176009   6.00266817  5.98347083  5.98475542  5.99396263
   6.00980741  6.01800954  6.03686764  6.07216556  6.09217605  6.13277798
   6.16261601  6.18322241  6.19601371  6.19605806  6.18136554  6.16230157
   6.12863718  6.09873444]
 [ 5.85232569  5.84568618  5.83852521  5.85650247  5.86062204  5.89958643
   5.92626612  5.95583911  6.00274438  6.02470948  6.04182969  6.06226839
   6.06443757  6.04390758  6.03026881  6.01816448  5.97465002  5.93588959
   5.90204558  5.87176084]
 [ 5.65508364  5.67334478  5.71674229  5.75423333  5.79606216  5.8374079
   5.8577061   5.89896977  5.9750162   5.9836415   5.99645753  5.99254929
   5.98719249  5.9527742   5.89442629  5.83334858  5.76588547  5.7133938
   5.67777195  5.65836254]
 [ 5.48185648  5.53971065  5.61208547  5.67518084  5.749705    5.7947819
   5.84665863  5.89884291  5.9225235   5.96054263  5.97990827  5.97349039
   5.94048222  5.87945032  5.79143825  5.67265563  5.58177218  5.49317136
   5.46236331  5.4463441 ]]

In [51]:
MY_DRIVER.execute()

In [52]:
result = MY_DRIVER.result
data = result.observable_results["correlation_length"]
print data["length_values"].size
print data["correlation_values"]
print "\n"
print result
x_data = np.sqrt(data["length_values"])
y_data = data["correlation_values"]


61
[ 1.          0.97441538  0.95256938  0.91918783  0.90190342  0.85796968
  0.84826063  0.83466822  0.79751497  0.77091841  0.76034768  0.74509463
  0.72937486  0.68835122  0.68693332  0.66144607  0.63309508  0.6240201
  0.6282214   0.62131446  0.59988506  0.57953912  0.56776883  0.57235392
  0.55507151  0.52915939  0.54775808  0.51974488  0.48816087  0.52991759
  0.5050354   0.50797999  0.44864297  0.48292994  0.44933286  0.45227341
  0.50344121  0.49823562  0.44857538  0.4192934   0.45978533  0.43116786
  0.38316057  0.40866035  0.48933231  0.47461056  0.40032927  0.451918
  0.35909147  0.42399504  0.37022778  0.39388508  0.33722058  0.34377565
  0.36444632  0.32330329  0.33852078  0.31027966  0.31849425  0.3057646
  0.30136908]


Class: <class 'MCMC.ResultContainer'>
bcs_params: {'hopping_constant': 0.25, 'uniform_phase': False, 'use_assaad': True, 'delta': 0.25, 'width': 20, 'J_constant': 0.02808988764044944, 'g_constant': 0.25, 'chem_potential': 0.0, 'temperature': 1.45e-11}
mc_params: {'intervals': 100, 'seed': 222315, 'target_snapshots': 25, 'observable_list': ['correlation_length']}
Code version: {'id': '0974bd6', 'time': '2014-08-16 22:30:21'}
Observable list: ['correlation_length']

In [53]:
fig, ax = plt.subplots(figsize = (10, 8), dpi=100, frameon=False)

ax.plot(x_data, y_data)

popt, pcov = curve_fit(func, x_data, y_data)
print popt
print "corr length:", 1.0/popt[1]
ax.plot(x_data, func(x_data, popt[0], popt[1], popt[2]))


[ 1.21469132  0.0758989  -0.14526748]
corr length: 13.1754222042
Out[53]:
[<matplotlib.lines.Line2D at 0x7fbe8b9f9b50>]

In [ ]:


In [ ]:


In [60]:
results = pickle.load( open( "result_corr_dwave_new.txt", "rb" ) )
results = np.append(results, pickle.load( open( "result_corr_dwave_new2.txt", "rb" ) ))
#results = np.append(results, pickle.load( open( "result_corr_dwave_4.txt", "rb" ) ))
#results = np.append(results, pickle.load( open( "result_corr_dwave_5.txt", "rb" ) ))
#results = np.append(results, pickle.load( open( "result_corr_dwave_6.txt", "rb" ) ))
data = results[0].observable_results["correlation_length"]
l_values = []
for elem in data['correlation_values']:
    l_values.append(np.average(elem))
print data["length_values"].size
print len(l_values)


135
135

In [61]:
datas = {}
temps =np.array([])
for elem in results:
    temps = np.append(temps, elem.bcs_params['temperature'])
temps = np.unique(temps)
for temp in temps:
    datas[temp] = np.array([elem for elem in results if elem.bcs_params['temperature']==temp])
print temps
print datas[temps[0]].size


[  120.    150.    180.    225.    270.    300.    337.5   375.    450.
   525.    600.    900.   1200.   1500. ]
32

In [62]:
x_datas = {}
y_datas = {}

for temp in temps:
    x_datas[temp] = np.sqrt(datas[temp][0].observable_results["correlation_length"]["length_values"])
    y_datas[temp] = np.zeros((x_datas[temp].size))
    total_sum = 0
    for elem in datas[temp]:
        y_datas[temp] +=\
            elem.observable_results["correlation_length"]["correlation_values"]
    y_datas[temp] /= datas[temp].size
#np.array([np.average(zob) for zob in elem.observable_results["correlation_length"]["correlation_values"]])

In [65]:
fig, ax = plt.subplots(figsize = (14, 12), dpi=100, frameon=False)
corr_lens = {}

for temp in temps:
    x_data = x_datas[temp]
    y_data = y_datas[temp]
    ax.plot(x_data, y_data, label=str(temp))
    popt, pcov = curve_fit(func, x_data, y_data)
    print "temp: ", temp, "params: ", popt, "length: ", 1.0/popt[1]
    corr_lens[temp] = 1.0/popt[1]
    ax.plot(x_data, func(x_data, popt[0], popt[1], popt[2]))
    
ax.legend()


temp:  120.0 params:  [ 1.14372054  0.23009512 -0.04266259] length:  4.34602874956
temp:  150.0 params:  [ 1.10762502  0.22314066 -0.03685925] length:  4.48147822085
temp:  180.0 params:  [ 1.09377588  0.22437676 -0.04093276] length:  4.45678948379
temp:  225.0 params:  [ 1.04074735  0.22113531 -0.04339766] length:  4.52211805846
temp:  270.0 params:  [ 0.96120445  0.22926338 -0.0261074 ] length:  4.36179555272
temp:  300.0 params:  [ 0.92824275  0.23624405 -0.0338617 ] length:  4.23291083972
temp:  337.5 params:  [ 0.89589153  0.33870323  0.01544003] length:  2.95243717962
temp:  375.0 params:  [ 0.90820289  0.44182946  0.01420455] length:  2.26331672678
temp:  450.0 params:  [ 0.97532524  0.74455971  0.00219452] length:  1.34307562404
temp:  525.0 params:  [ 0.99338141  1.00944174  0.00136639] length:  0.990646571302
temp:  600.0 params:  [  9.97993428e-01   1.20860871e+00   7.89160939e-04] length:  0.827397647455
temp:  900.0 params:  [  1.00017233e+00   1.72023878e+00   3.24411766e-04] length:  0.581314647837
temp:  1200.0 params:  [  1.00035941e+00   2.04283842e+00   1.09660712e-05] length:  0.489514974763
temp:  1500.0 params:  [  1.00022174e+00   2.27974489e+00   2.77868136e-05] length:  0.438645571709
Out[65]:
<matplotlib.legend.Legend at 0x7fbe8b67a490>

In [70]:
fig, ax = plt.subplots(figsize = (14, 12), dpi=100, frameon=False)
x_es = np.sort(np.array(corr_lens.keys()))
y_es = np.array([corr_lens[elem] for elem in x_es])

ax.plot(x_es, y_es)
ax.grid(True)
plt.savefig("corr_length.pdf")



In [ ]:
a = np.array([1.125, 1.25, 1.5, 1.75, 2.0, 3.0, 4.0, 5.0])

In [199]:
fig, ax = plt.subplots(figsize = (10, 8), dpi=100, frameon=False)

for temp in temps:
    x_data = x_datas[temp]
    y_data = y_datas[temp]
    ax.plot(x_data, y_data, label=str(temp))
    popt, pcov = curve_fit(func, x_data, y_data)
    print "temp: ", temp, "params: ", popt, "length: ", 1.0/popt[1]
    ax.plot(x_data, func(x_data, popt[0], popt[1], popt[2]))
ax.legend()


temp:  160.0 params:  [ 1.09653208  0.24600817 -0.01083993] length:  4.06490561045
temp:  240.0 params:  [ 1.00797558  0.21518256 -0.04210618] length:  4.64721669121
Out[199]:
<matplotlib.legend.Legend at 0x7f951a3410d0>

In [123]:
print results


Class: <class 'MCMC.ResultContainer'>
bcs_params: {'hopping_constant': 0.25, 'uniform_phase': False, 'use_assaad': True, 'delta': 0.25, 'width': 20, 'J_constant': 0.02808988764044944, 'g_constant': 0.25, 'chem_potential': 0.0, 'temperature': 290.0}
mc_params: {'intervals': 100, 'seed': 222315, 'target_snapshots': 25, 'observable_list': ['correlation_length']}
Code version: {'id': '17a27b8', 'time': '2014-08-14 11:46:36'}
Observable list: ['correlation_length']

In [121]:
fig, ax = plt.subplots(figsize = (10, 8), dpi=100, frameon=False)

ax.plot(np.sqrt(data["length_values"]), np.log(l_values - popt[2]))

ax.plot(np.sqrt(data["length_values"]), np.log(popt[0]) - popt[1] * np.sqrt(data["length_values"]))


Out[121]:
[<matplotlib.lines.Line2D at 0x7f951a3e7110>]

In [454]:
fig, ax = plt.subplots(figsize = (10, 8), dpi=100, frameon=False)

x_values = MY_DRIVER.mc_object.lattice.omega_mesh / T_CST
xmin = np.amin(x_values)
xmax = np.amax(x_values)

ax.set_xlim([xmin, xmax])
ax.set_xticks(np.linspace(int(xmin), int(xmax), 13,endpoint=True))

ax.plot(x_values, dos_values)


Out[454]:
[<matplotlib.lines.Line2D at 0x7f0d98e7df10>]

In [562]:
print MY_DRIVER.observable_results


{}

In [383]:
MY_DRIVER.mc_object.temperature = 1.0 * 145.0
MY_DRIVER.thermalize(20000)

In [385]:
fig, ax = plt.subplots(figsize = (10, 8), dpi=100, frameon=False)

x_axis_ampl = 4.5
xmin = -x_axis_ampl
xmax = x_axis_ampl

ax.set_xlim([xmin, xmax])
#ax.set_ylim([0.0, 1.0])
ax.set_xticks(np.linspace(int(xmin), int(xmax), 9,endpoint=True))
#ax.set_yticks(np.linspace(xmin, xmax, 5,endpoint=True))
#ax.set_xticklabels(['%1.1f'  %elem for elem in np.linspace(xmin, xmax,5,endpoint=True)])
#ax.set_yticklabels(['%1.1f'  %elem for elem in np.linspace(xmin, xmax,5,endpoint=True)])

MY_DRIVER.execute()
dos_values = np.real(MY_DRIVER.observable_results["DOS"])

ax.plot(MY_DRIVER.mc_object.lattice.omega_mesh / T_CST, dos_values)


Out[385]:
[<matplotlib.lines.Line2D at 0x7f0d9908ea50>]

In [ ]:


In [ ]:
1500/ 450

In [ ]:


In [ ]:


In [582]:
#300K
temps = [15, 113, 150, 155, 300, 450, 600, 800, 1200]
names = ['./result_dwave_' + str(temp)+'.txt' for temp in temps]
input_files = [np.loadtxt(name) for name in names]

In [585]:
print len(input_files[3])


1001

In [609]:
fig, ax = plt.subplots(figsize = (10, 8), dpi=100, frameon=False)

x_axis_ampl = 6.0 * T_CST
nb_ticks = 1001
xvalues = np.linspace(-x_axis_ampl, x_axis_ampl, nb_ticks, endpoint=True)

#ymin = 0.0
#ymax = 0.5
xmin = -x_axis_ampl
xmax = x_axis_ampl

ax.set_xlim([xmin, xmax])
#ax.set_ylim([0.0, 2.0])
ax.set_xticks(np.linspace(int(xmin), int(xmax), 9,endpoint=True))
#ax.set_yticks(np.linspace(xmin, xmax, 5,endpoint=True))
#ax.set_xticklabels(['%1.1f'  %elem for elem in np.linspace(xmin, xmax,5,endpoint=True)])
#ax.set_yticklabels(['%1.1f'  %elem for elem in np.linspace(xmin, xmax,5,endpoint=True)])


for i in range(len(input_files)):
    ax.plot(xvalues/T_CST, input_files[i], ls = '-', label = str(temps[i]))

ax.legend(loc=2)
plt.savefig("DOS.pdf")



In [297]:
#200K
out = np.loadtxt('result_dwave_750.txt')

In [298]:
fig, ax = plt.subplots(figsize = (10, 8), dpi=100, frameon=False)

x_axis_ampl = 4.2
nb_ticks = 1001
xvalues = np.linspace(-x_axis_ampl, x_axis_ampl, nb_ticks, endpoint=True)

#ymin = 0.0
#ymax = 0.5
xmin = -x_axis_ampl
xmax = x_axis_ampl

ax.set_xlim([xmin, xmax])
#ax.set_ylim([0.0, 1.0])
ax.set_xticks(np.linspace(int(xmin), int(xmax), 9,endpoint=True))
#ax.set_yticks(np.linspace(xmin, xmax, 5,endpoint=True))
#ax.set_xticklabels(['%1.1f'  %elem for elem in np.linspace(xmin, xmax,5,endpoint=True)])
#ax.set_yticklabels(['%1.1f'  %elem for elem in np.linspace(xmin, xmax,5,endpoint=True)])

ax.plot(xvalues/0.25, out)
plt.savefig("DOS_dwave_T_KT.pdf")



In [227]:
150.0*1.75


Out[227]:
262.5

In [303]:
print cst.physical_constants["Boltzmann constant in eV/K"][0]


8.6173324e-05

In [ ]: