71
Olivier Parcollet Institut de Physique Théorique CEA Saclay, France TRIQS A Toolbox for Research in Interacting Quantum Systems 1

TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Olivier Parcollet

Institut de Physique Théorique

CEA Saclay,

France

TRIQS

A Toolbox for Research in Interacting

Quantum Systems

1

Page 2: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Team for the hands-on 2

Priyanka Seth

Michel FerreroO. Parcollet

Manuel ZinglGernot Kraberger

Page 3: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

What is TRIQS ?

• A Toolbox in Python & C++ to build modern many body computations:

• DMFT methods [ Today’s topic]

• Ab-initio strongly correlated materials (DFT+ DMFT).

• Cluster DMFT methods.

• Third generation methods: self-consistency with two particles Green functions.

• TRIQS is not limited to DMFT methods.

• Other many-body computations.e.g. Eliashberg type equations (superconductivity, spin-fluctuations...)

• Some tools are very general, beyond condensed matter physics.

3

Page 4: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Outline

• Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver.

• Overview of the TRIQS project

• A few highlights of the contents of the library in Python & C++

• Hands-on:

• You will build a little IPT solver at half-filling with TRIQS and run it to recover a classical result for Mott transition in DMFT.

• Then compare with TRIQS exact and general CT-HYB quantum impurity solver

• Finish with a 2 orbital model, study the role of U vs Jhund

4

Page 5: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

5

Motivating example

Let’s do a DMFT computation in Python using TRIQS

Page 6: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

H = �J�

ij

⇥i⇥j H = ��

ij⇥

tijc†i⇥cj⇥ + Uni⇥ni⇤

m = ⇤⇥⌅ Gc(⇤) = �⇤Tc(⇤)c†(0)⌅Seff

He� = �Jhe�⇥ Se� = �⇥ �

0c†⇥(⇤)G�1

0 (⇤ � ⇤ ⌅)c⇥(⇤ ⌅) +⇥ �

0d⇤Un⇥(⇤)n⇤(⇤)

he� = zJm G0(i⌅n) = Flattice[Gc](i⌅n) : Self-consistency condition

m = tanh(�he�) Solution of the quantum impurity model

Reminder : DMFT on Bethe lattice 6 withnearest-neighborhoppingt ij�t/�z,forarbitrary

connectivityz.Weconcentrateonsiteoandperform

theGaussianintegrationoverallothersites(Fig.86).

Setting⇧⇣i�n+�,thisyields

Goo

⇤1 ⌅⇧⌘�⇧⇤

t2 z� ↵i,o�

Gii⌅o

⌘ �⇧⇤t2 Gii⌅o

⌘ .

(A39)

InthisequationidenotesaneighborofoandGii(o

)is

theGreen’sfunctionofsiteionceohasbeenremoved.

Translationinvariancehasbeenused,allsitesibeing

identical.Forfiniteconnectivityhowever,Gii(o

)doesnot

coincidewithGooeveninthelimitofaninfinitelattice.

Thisisbecausethelocaltopologyhasbeenchanged

whenremovingsiteo:eachneighborinowhasonlyz�1

nearestneighbors.Forlargeconnectivity,thisisof

coursea1/zeffect,andGii(o

)canbeidentifiedtoGooin

theequationabove,yieldingaclosedformula.Evenfor

finiteconnectivityhowever,theeliminationprocesscan

betakenonestepfurther,performingtheGaussianin-

tegrationoverthez�1neighborsofeachsitei.This

yields ⇥Gii⌅o

⌘ �⇤1 �⇧⇤⌅z⇤1⌘

t2 zGjj⌅o

,i ⌘ .

(A40)

Inthisequation,Gjj(o

,i) denotestheGreen’sfunctionofa

neighborjofi,inthetruncatedtreewherebothsiteso

andihavebeenremoved.Foraninfinitelattice,jis

entirelysimilartoi,sothatGii(o

) �Gjj(o

,i) .Thisyieldsa

closedequationforthisquantity:

z⇤1

z

t2 ⇥Gii⌅o

⌘ �2 ⇤⇧Gii⌅o

⌘ ⇥1�0,

(A41)

fromwhichthelocalGreen’sfunctionG⇣Goo[whichis

alsotheHilberttransformD˜(⇧)ofthedensityofstates]

isfinallyobtainedas[forIm(⇧)>0]

G⇣D˜⌅⇧⌘�

⌅z⇤2⌘⇧⇤z�⇧

2 ⇤4⌅z⇤1⌘t2 /z

2⌅zt2 ⇤⇧

2 ⌘

.

(A42)

ThedensityofstatesD( ⌃)=�ImG(⌃⇥i0

⇥)/✏thusreads

D⌅⌃⌘�

�⌃

2 ⇤4⌅z⇤1⌘t2 /z

2✏⌅t2 ⇤⌃

2 /z⌘

.

(A43)

(Onecancheckthatthefamiliard=1expressioncanbe

recoveredforz=2.)Takingthez� limityieldstheex-

pressionsoftenusedinthisarticle:

G⇣D˜⌅⇧⌘�

⇧⇤�⇧

2 ⇤4t2

2t2

,D⌅⌃⌘�

�⌃

2 ⇤4t2

2✏t2

.(A44)

Itmayalsobeusefultoquotetheexpressionofthe

reciprocalfunctionR(G)oftheHilberttransformD˜(⇧),

i.e.,suchthatR(D˜(⇧))=⇧.Forarbitraryconnectivity,itis

thesolutionofthequadraticequation:

⌅z⇤1⌘R

2 ⇥⌅z⇤1⌘ ⌅z⇤2⌘

G

R

⇤⌅z⇤1⌘2 ⇥

zz⇤1

t2 ⇥

1 G2��0.

(A45)

Forz� ,onerecovers(Sec.II)

R⌅G⌘�t2 G⇥

1 G.

(A46)

APPENDIXB:DETAILSOFTHEMONTECARLO

ALGORITHM

InthisAppendix,wefirstsketchthederivationof

someoftheformulasinSec.VI.A.1,andshowthe

equivalenceoftheHirsch-Fyeapproachwiththe

Blanckenbeckler,Scalapino,andSugaralgorithm.We

alsoprovidesomeguidancefortheQMCprogramspro-

videdwiththisarticle.Finally,detailsaregivenonthe

numericalimplementationoftheself-consistencycondi-

tion.

1.Somederivations

Equation(139)forthediscretizedpartitionfunction

canbeestablishedbymakinguseofthefollowingiden-

tity:Trc

i⇥,ci✓e

⇤�ijci⇥

Aijcj e

⇤�ijci⇥

Bijcj e

⇤�ijci⇥

Cijcj ⌥

⇣det ⇥1⇥e

⇤A e⇤B e⇤C�,

(B1)

andofitsgeneralizationtomorethanthreematrices.

Equation(B1)iseasilyderivedusingtherulesofGauss-

ianintegrationforGrassmannvariables,andaveryin-

structiveelementaryderivationcanbefoundin(Hirsch,

1985).TheequivalenceofdetOs 1,...,s LwiththeBlanck-

enbeckler,Scalapino,andSugarformulaEq.(139)can

thenbeshownbyGaussianelimination(replacingsuc-

cessivelythefirstrowofObymultiplesofrows

L,L�1,...,1,

✓O1i⌥ i�1,...,L�✓O1i⇤BLBL⇤1•••BL⇤k⇥1

⇤OL⇤k⇥1,i⌥ i�1,...,Lfork�0,1,...,L⇤1).

FIG.86.Bethelattice(depictedherewithconnectivityz=3).

117

A.Georgesetal.:Dynamicalmean-fieldtheoryof...

Rev.Mod.Phys.,Vol.68,No.1,January1996

�(i⇥n) = t2 Gc(i⇥n)

G�10 (i⇥n) = i⇥n + µ��(i⇥n)

• DMFT equations (Cf D. Sénéchal’s lecture yesterday).

• Bethe lattice with infinite connectivity. Semi-circular d.o.s.

• Goal: Solve DMFT equations, self-consistently with CT-INT.

SELF CONSISTENCY

IMPURITY PROBLEM

G0 Gc, Σ

A. Georges, G. Kotliar, W. Krauth and M. Rozenberg, Rev. Mod. Phys. 68, 13, (1996)

Page 7: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

How to do it ?

• Which parts ?

• Local Green functions

• An impurity solver: e.g. the CT-INT solver.

• Save the result.

• Plot it.

7

• Break the DMFT computation into small parts and assemble the computation.

Page 8: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Assemble a DMFT computation in 1 slide

• A complete code, using a CT-INT solver (one of the TRIQS apps).

• In Python, with parallelization included (mpi).

• Do not worry about the details of the syntax at this stage(Cf the hands-on).Get an idea of how to use TRIQS by example.

8

Page 9: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

DMFT computation in 1 slide

• Import some basic blocks (Green function, a solver) ...

• Define some parameters and declare a CT-INT solver S

• All TRIQS solvers contains G, G0, Σ as members with the correct β, dimensions, etc...

• Initialize S.G_iw to a (the Hilbert transform of a) semi-circular dos.

9

from pytriqs.gf.local import *from pytriqs.applications.impurity_solvers.ctint_tutorial import CtintSolver

U = 2.5 # Hubbard interactionmu = U/2.0 # Chemical potentialhalf_bandwidth=1.0 # Half bandwidth (energy unit)beta = 40.0 # Inverse temperaturen_iw = 128 # Number of Matsubara frequenciesn_cycles = 10000 # Number of MC cyclesdelta = 0.1 # delta parametern_iterations = 21 # Number of DMFT iterations

S = CtintSolver(beta, n_iw) # Initialize the solver

S.G_iw << SemiCircular(half_bandwidth) # Initialize the Green's function

Page 10: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

DMFT computation in 1 slide

• Implement DMFT self-consistency condition

10

from pytriqs.gf.local import *from pytriqs.applications.impurity_solvers.ctint_tutorial import CtintSolver

U = 2.5 # Hubbard interactionmu = U/2.0 # Chemical potentialhalf_bandwidth=1.0 # Half bandwidth (energy unit)beta = 40.0 # Inverse temperaturen_iw = 128 # Number of Matsubara frequenciesn_cycles = 10000 # Number of MC cyclesdelta = 0.1 # delta parametern_iterations = 21 # Number of DMFT iterations

S = CtintSolver(beta, n_iw) # Initialize the solver

S.G_iw << SemiCircular(half_bandwidth) # Initialize the Green's function

for sigma, G0 in S.G0_iw: # sigma = ‘up’, ‘down’ G0 << inverse(iOmega_n + mu - (half_bandwidth/2.0)**2 * S.G_iw[sigma] ) # Set G0

G�10� (i!n) = i!n + µ� t2Gc�(i!n), for � =", #

Page 11: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

DMFT computation in 1 slide

• Call the solver.

• From G0σ(iωn) (and various parameters), it computes Gσ(iωn) for σ=↑,↓

11

from pytriqs.gf.local import *from pytriqs.applications.impurity_solvers.ctint_tutorial import CtintSolver

U = 2.5 # Hubbard interactionmu = U/2.0 # Chemical potentialhalf_bandwidth=1.0 # Half bandwidth (energy unit)beta = 40.0 # Inverse temperaturen_iw = 128 # Number of Matsubara frequenciesn_cycles = 10000 # Number of MC cyclesdelta = 0.1 # delta parametern_iterations = 21 # Number of DMFT iterations

S = CtintSolver(beta, n_iw) # Initialize the solver

S.G_iw << SemiCircular(half_bandwidth) # Initialize the Green's function

for sigma, G0 in S.G0_iw: G0 << inverse(iOmega_n + mu - (half_bandwidth/2.0)**2 * S.G_iw[sigma] ) # Set G0

S.solve(U, delta, n_cycles) # Solve the impurity problem

Page 12: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

DMFT computation in 1 slide

• DMFT iteration loop

12

from pytriqs.gf.local import *from pytriqs.applications.impurity_solvers.ctint_tutorial import CtintSolver

U = 2.5 # Hubbard interactionmu = U/2.0 # Chemical potentialhalf_bandwidth=1.0 # Half bandwidth (energy unit)beta = 40.0 # Inverse temperaturen_iw = 128 # Number of Matsubara frequenciesn_cycles = 10000 # Number of MC cyclesdelta = 0.1 # delta parametern_iterations = 21 # Number of DMFT iterations

S = CtintSolver(beta, n_iw) # Initialize the solver

S.G_iw << SemiCircular(half_bandwidth) # Initialize the Green's function

for it in range(n_iterations): # DMFT loop for sigma, G0 in S.G0_iw: G0 << inverse(iOmega_n + mu - (half_bandwidth/2.0)**2 * S.G_iw[sigma] ) # Set G0

S.solve(U, delta, n_cycles) # Solve the impurity problem

SELF CONSISTENCY

IMPURITY PROBLEM

G0 Gc, Σ

Page 13: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

DMFT computation in 1 slide

• Enforce the fact that the solution is paramagnetic, cf DMFT lecture. (noise in the QMC would lead to a AF solution after iterations).

13

from pytriqs.gf.local import *from pytriqs.applications.impurity_solvers.ctint_tutorial import CtintSolver

U = 2.5 # Hubbard interactionmu = U/2.0 # Chemical potentialhalf_bandwidth=1.0 # Half bandwidth (energy unit)beta = 40.0 # Inverse temperaturen_iw = 128 # Number of Matsubara frequenciesn_cycles = 10000 # Number of MC cyclesdelta = 0.1 # delta parametern_iterations = 21 # Number of DMFT iterations

S = CtintSolver(beta, n_iw) # Initialize the solver

S.G_iw << SemiCircular(half_bandwidth) # Initialize the Green's function

for it in range(n_iterations): # DMFT loop for sigma, G0 in S.G0_iw: G0 << inverse(iOmega_n + mu - (half_bandwidth/2.0)**2 * S.G_iw[sigma] ) # Set G0

S.solve(U, delta, n_cycles) # Solve the impurity problem

G_sym = (S.G_iw['up'] + S.G_iw['down'])/2 # Impose paramagnetic solution S.G_iw << G_sym

Page 14: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

DMFT computation in 1 slide

• Accumulate the various iterations in a (hdf5) file

14

from pytriqs.gf.local import *from pytriqs.applications.impurity_solvers.ctint_tutorial import CtintSolverfrom pytriqs.archive import HDFArchive

U = 2.5 # Hubbard interactionmu = U/2.0 # Chemical potentialhalf_bandwidth=1.0 # Half bandwidth (energy unit)beta = 40.0 # Inverse temperaturen_iw = 128 # Number of Matsubara frequenciesn_cycles = 10000 # Number of MC cyclesdelta = 0.1 # delta parametern_iterations = 21 # Number of DMFT iterations

S = CtintSolver(beta, n_iw) # Initialize the solver

S.G_iw << SemiCircular(half_bandwidth) # Initialize the Green's function

for it in range(n_iterations): # DMFT loop for sigma, G0 in S.G0_iw: G0 << inverse(iOmega_n + mu - (half_bandwidth/2.0)**2 * S.G_iw[sigma] ) # Set G0

S.solve(U, delta, n_cycles) # Solve the impurity problem G_sym = (S.G_iw['up'] + S.G_iw['down'])/2 # Impose paramagnetic solution S.G_iw << G_sym

with HDFArchive("dmft_bethe.h5",'a') as A: A['G%i'%it] = G_sym # Save G from every iteration to file as G1, G2, G3....

Page 15: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

• Change the random generator at the last iteration !

DMFT computation in 1 slide 15

from pytriqs.gf.local import *from pytriqs.applications.impurity_solvers.ctint_tutorial import CtintSolverfrom pytriqs.archive import HDFArchive

U = 2.5 # Hubbard interactionmu = U/2.0 # Chemical potentialhalf_bandwidth=1.0 # Half bandwidth (energy unit)beta = 40.0 # Inverse temperaturen_iw = 128 # Number of Matsubara frequenciesn_cycles = 10000 # Number of MC cyclesdelta = 0.1 # delta parametern_iterations = 21 # Number of DMFT iterations

S = CtintSolver(beta, n_iw) # Initialize the solver

S.G_iw << SemiCircular(half_bandwidth) # Initialize the Green's function

for it in range(n_iterations): # DMFT loop for sigma, G0 in S.G0_iw: G0 << inverse(iOmega_n + mu - (half_bandwidth/2.0)**2 * S.G_iw[sigma] ) # Set G0 # Change random number generator on final iteration random_name = 'mt19937' if it < n_iterations-1 else 'lagged_fibonacci19937'

S.solve(U, delta, n_cycles, random_name=random_name) # Solve the impurity problem

G_sym = (S.G_iw['up']+S.G_iw['down'])/2 # Impose paramagnetic solution S.G_iw << G_sym

with HDFArchive("dmft_bethe.h5",'a') as A: A['G%i'%it] = G_sym # Save G from every iteration to file

Page 16: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Look at the result (in IPython notebook) 16

A = HDFArchive("dmft_bethe.h5",'r') # Open file in read modefor it in range(21): if it%2: # Plot every second result

oplot(A['G%i'%it], '-o', mode=’I’, name='G%i'%it)

DMFT convergence

Imaginary part onlyRetrieve Gi from the file, and use it at once

oplot can plot many TRIQS objects via matplotlib

NBlines are guide to the eyes,

only Matsubara frequency point matters

Page 17: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Summarize what we have done so far

• A fully functional DMFT code.

• Computation & data analysis: all in Python.

• Green functions, solvers are used as Python classes.

• Since it is a script, it is easy to change various details, e.g.

• Self-consistency condition: enforce paramagnetism

• Change random generator

• Change starting point (e.g. reload G from a file).

• Improve convergence (e.g. mixing quantities over iterations).

• Measure e.g. susceptibilities only at the end of the DMFT loop

17

Page 18: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

FAQ : Where was the input file ?

• Traditional way: a monolithic program, input files, output files.

• Python/TRIQS way : write your own script with full control

• No input file as text : no need to parse it, we can do operations on the fly, use Python to prepare data ...

18

from pytriqs.gf.local import *from pytriqs.applications.impurity_solvers.ctint_tutorial import CtintSolver

U = 2.5 # Hubbard interactionmu = U/2.0 # Chemical potentialhalf_bandwidth=1.0 # Half bandwidth (energy unit)beta = 40.0 # Inverse temperaturen_iw = 128 # Number of Matsubara frequenciesn_cycles = 10000 # Number of MC cyclesdelta = 0.1 # delta parametern_iterations = 21 # Number of DMFT iterations

...

Page 19: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

19

Why a library rather than a monolithic program ?

Page 20: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Library vs monolithic program

• Better to have a simple language to express your calculation.

• Since many-body approaches are quite versatile.

• Let me illustrate this point with examples of DMFT-like methods

• Many impurity solvers (e.g. CT-QMC, ED, IPT, DMRG, NCA, ...)

• Various impurity models (# of orbitals, symmetries, clusters)

• Many self-consistency conditions ...

20

Page 21: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

DMFT: correlated vs uncorrelated orbitals

• Select some correlated orbitals, even in models for cuprates, e.g.

21

Cu

Cu Cu

Cu

O

O

O

O

• Self-consistency in large unit cell (Cu + 2 O)Σab(ω) a 3x3 matrix

• Interaction only on Cu. Impurity model is one band, with Σimp(ω) a 1x1 matrix

⌃(!) =

0

@⌃imp(!) 0 0

0 0 00 0 0

1

A

Page 22: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Mix with electronic structure codes 22

!"#$%&'#()*+,$-)*'#(./0$'&',$(1/00232#

!"#$%&'( )*("#$%+,-."+&'"$(*/*0%('*.'*1'$! !"#$%&'()*+,--).*" /&'()*0,1)*2*345567.*! %#,%#89- 345:57

2&,3'(*"4&$%51$,6.(4*/&'()*0,1)*+,--)*3455;7

78(&93'(*3%:-;&6<"'(*1$"(&$;(<*/&'()*0,1)*2*3455=.455>.455?.455@7

4-+5/,+3-#+$-/,('6+1$'7(8/,$'(9+03/()*+,$-)*'(:'(3+(./,1$-/,(:'(;0'',

=3#"$'&;(*<"%-&6<"'(! A$"#9BC*$D*/&'(8E( 3455@7

;0/*<'(:'(0',/0&+3-#+$-/,,*&20-)*'(:'(=-3#/,

82$+3(2$0+,5'

>-)*-:'(?'0&-!*<0+

@

:/<+5'

9A+&<(&/"',(:",+&-)*'7(8/,$'(9+03/()*+,$-)*'(',($'&<#(1/,$-,*

Fe-Based (2008)

! !

!"#$%&'()$)*+,-*,+.$&'($.'.+/0$12'(31

!""453(.678'.+/0$94:;<=>$.?

@,2*.$63-&62A.(B&''2.+)

C&+&5.*.+)$D-EC#F7

G.$!#$%$H$I$.?

#)$"

J$"

K'3--,L2.($)*&*.)$D!&F

• Cf Lectures by Kotliar next week.

• (Much) more of the same kind of manipulations:Extract the Green function of the correlated orbitals.E.g. project on Wannier functions.Embed the self-energy of the correlated orbital (downfolding).

Page 23: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Role of geometry

• Real space DMFT : ultra-cold atomsCf lecture by D. Sénéchal.

• Disordered systems Cf e.g. work of Dobrosavljević et al.

• One DMFT impurity for each part (red, blue).

• Linked by self-consistency condition, taking into account disorder

• Correlated interfaces. Cf e.g. Okamoto & Millis

• One DMFT impurity for each layer x

• Coupled by self-consistency condition

23

..............................................................

Artificial charge-modulationin atomic-scale perovskitetitanate superlatticesA. Ohtomo, D. A. Muller, J. L. Grazul & H. Y. Hwang

Bell Laboratories, Lucent Technologies, Murray Hill, New Jersey 07974, USA.............................................................................................................................................................................

The nature and length scales of charge screening in complexoxides are fundamental to a wide range of systems, spanningceramic voltage-dependent resistors (varistors), oxide tunneljunctions and charge ordering in mixed-valence compounds1–6.There are wide variations in the degree of charge disproportio-nation, length scale, and orientation in the mixed-valence com-pounds: these have been the subject of intense theoretical study7–11, but little is known about the microscopic electronic structure.Here we have fabricated an idealized structure to examine theseissues by growing atomically abrupt layers of LaTi31O3

embedded in SrTi41O3. Using an atomic-scale electron beam,we have observed the spatial distribution of the extra electron onthe titanium sites. This distribution results in metallic conduc-tivity, even though the superlattice structure is based on twoinsulators. Despite the chemical abruptness of the interfaces, wefind that a minimum thickness of five LaTiO3 layers is requiredfor the centre titanium site to recover bulk-like electronic proper-ties. This represents a framework within which the short-length-scale electronic response can be probed and incorporated in thin-film oxide heterostructures.In perovskites, charge ordering results in modulations of the

electron density in the form of planes and slabs, whereas in lower-dimensional perovskite-derived systems, charge ordering leads tostripes, or one-dimensional charge modulations. Approximationsto the first case can be realized in thin-film superlattices inwhich theformal valence of the transition-metal ion is varied. Superlattices ofSrTiO3 and LaTiO3 are addressed here, where the titaniumvalence isvaried from 4þ to 3þ. SrTiO3 is a band insulator with an empty dband, whereas LaTiO3 has one d electron per site, and strongCoulomb repulsion results in a Mott–Hubbard insulator12. Super-lattices of these two perovskites capture many of the importantaspects of naturally occurring charge-ordered systems, namelymixed-valence configurations near half-filling. The lattice constantsare relatively well matched (for SrTiO3, ao ¼ 3.91 A; LaTiO3,pseudocubic ao ¼ 3.97 A), and the continuity of the TiO6 octa-hedral lattice across the superlattice minimizes the perturbation ofthe electronic states near the chemical potential13,14. The principalgrowth issue reduces to the control of the titanium oxidation state,which we have recently addressed for bulk-like film growth15.We grew SrTiO3/LaTiO3 superlattice films in an ultrahigh-

vacuum chamber (Pascal) by pulsed laser deposition, using asingle-crystal SrTiO3 target and a polycrystalline La2Ti2O7 target.Extreme care was taken to start with atomically flat, TiO2-terminated SrTiO3 substrates, which exhibited terraces severalhundred nanometres wide, separated by 3.91-A unit cell steps asobserved by atomic force microscopy16. A KrF excimer laser with arepetition rate of 4Hz was used for ablation, with a laser fluence atthe target surface of,3 J cm22. The films were grown at 750 8Cwithan oxygen partial pressure of 1025 torr, which represented the bestcompromise for stabilizing both valence states of titanium. Oscil-lations in the unit-cell reflection high-energy electron diffractionintensity were observed throughout the growth, and were used tocalibrate the number of layers grown. After growth, the films wereannealed in flowing oxygen at 400 8C for 2–10 hours to fill residualoxygen vacancies.

Figure 1 shows the annular dark field (ADF) image of a super-lattice sample obtained by scanning transmission electronmicroscopy (JEOL 2010F) of a 30-nm-thick cross-section along asubstrate [100] zone axis. In this imaging mode, the intensity ofscattering scales with the atomic number Z as Z1.7, so the brightestfeatures are columns of La ions, the next brightest features arecolumns of Sr ions, and the Ti ions are weakly visible in between17–19.The quality of the interfaces does not degrade with continueddeposition, and the atomic step and terrace structure of the growingsurface is maintained for hundreds of nanometres. The magnifiedview at the top of Fig. 1 shows a higher-resolution image, whichvisibly demonstrates the ability to grow a single layer of La ions.Because the layer is viewed in projection, roughness along thebeam—particularly on length scales thinner than the sample—leads to apparent broadening. Thus these results represent anupper limit to the actual width of the layers.

With the same imaging conditions used to obtain Fig. 1, weanalysed the energy of the transmitted electron beam and per-formed core level spectroscopy, atom column by atom column20–22.This approach is able to probe internal structures directly, unlikesurface-sensitive methods. Specifically, the titanium L2,3, oxygen K,and lanthanumM4,5 edges can be simultaneously recorded, with anenergy resolution of,0.9 eV and a spatial resolution slightly worsethan the ADF resolution of,1.9 A, primarily owing to drift duringthe slower acquisition of the spectra. We obtained a scan throughthe Ti sites crossing a 2-unit-cell layer of LaTiO3 (top centre panel ofFig. 2). By substituting La for Sr, there is locally an extra electronthat resides mainly on the Ti d orbitals23. To visualize this effect, theTi L2,3 near-edge structure can be decomposed into a linearcombination of Ti3þ and Ti4þ, with no residual detectable abovethe experimental noise level (bottom panel of Fig. 2).

This decomposition, which would fail both conceptually andexperimentally for more covalent materials, allows a particularly

Figure 1 Annular dark field (ADF) image of LaTiO3 layers (bright) of varying thickness

spaced by SrTiO3 layers. The view is down the [100] zone axis of the SrTiO3 substrate,

which is on the right. After depositing initial calibration layers, the growth sequence is

5 £ n (that is, 5 layers of SrTiO3 and n layers of LaTiO3), 20 £ n, n £ n, and finally a

LaTiO3 capping layer. The numbers in the image indicate the number of LaTiO3 unit cells

in each layer. Field of view, 400 nm. Top, a magnified view of the 5 £ 1 series. The raw

images have been convolved with a 0.05-nm-wide gaussian to reduce noise.

letters to nature

NATURE | VOL 419 | 26 SEPTEMBER 2002 | www.nature.com/nature378 © 2002 Nature Publishing Group

SrTiO3/LaTiO3 Ohtomo et al, Nature 2002

Alloy

x

Page 24: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Goal: unify both pictures

… in the simplest way

Capture Mott physicsDMFT: local physics

Capture long-ranged bosonic fluctuationsSpin fluctuation theory

with a control parametercluster size

Cluster DMFT

• DMFT: 1 atom (Anderson impurity) + effective self-consistent bath

24

⌃(k,!) ⇡ ⌃impurity(!)

Reciprocal space (DCA)clusters Brillouin zone patching

3

(�, �)

(0, 0)

(0, �)

(�, 0)(0, 0)

(�, �) (0, �)

(�, 0)

(�, �)

(0, 0) (0, 0)

(�, �)

(�/2, �/2)

(�, 0)

(0, 0)

(�, �)

FIG. 2: Momentum space tiling used to define cluster approximations studied here: 2-site (leftmost panel), 4-site with stan-dard patching (second from left), 4-site with alternative patching (4⇤), (central panel), 8-site (second from right) and 16-site(rightmost panel). Momentum space patches indicated by shaded regions; electron self energy is independent of momentumwithin a patch but may vary from patch to patch. Dots (red online) represents the K points in reciprocal space associated tothe patches in the DCA construction (see text). Thin lines : Fermi surfaces for the non-interacting system with t0 = �0.15tfor half filling and hole dopings of 10%, 20%, and 30%. All clusters have an inner patch around (0, 0) (yellow online) and anouter patch around (�, �) (green online). Clusters with four or more sites also have an antinodal patch at (�, 0) and symmetryrelated points (blue online), clusters with eight or more sites have a nodal patch ((�/2, �/2), red online). The 16-site clusterhas two additional independent momentum sectors, around (�/2, 0) (orange online) and around (3�/2, �/2) (cyan online). Allclusters have the full point group symmetry of the lattice.

field, given present computational capabilities, and callfor a new generation of theoretical developments aimingat improving momentum-space resolution.

While the various aspects of the doping-dependentphase diagram of the two dimensional Hubbard modelhave been noted in various ways in the cluster dynam-ical mean field literature, the generality of the resultsand their robustness to choice of cluster have not beenpreviously appreciated. The comparison of results fordi�erent sized clusters clearly demonstrates that the es-sentials of the carrier concentration dependence of phys-ical properties of a doped Mott insulator are as sketchedin Fig. 1. Far from the insulating state, the propertiesare those of a moderately correlated Fermi liquid. More-over, the momentum dependence of the renormalizationsis very weak: the properties are described well by single-site dynamical mean field theory, as previously noted e.g.in Refs. 30,31. We refer to this regime as the isotropicFermi liquid. (Note that “isotropic” here means isotropicscattering properties (self energy) along the Fermi sur-face, but the Fermi surface is not circular.) As the dop-ing is decreased towards the n = 1 insulating state thesystem enters an intermediate doping regime where thelow temperature behavior is still described by Fermi liq-uid theory, but the Fermi liquid is characterized by astrong momentum dependence of the renormalizations,with the renormalizations being largest near the zone cor-ner (0,�)/(�, 0) points and smallest near the zone diago-nal (±�/2,±�/2) regions of momentum space. We referto this as the regime of momentum space di�erentiation.The change between the isotropic and momentum-spacedi�erentiated Fermi liquid regimes is not characterized byany order parameter and we believe it to be a crossover,not a transition, but the doping at which the change oc-curs is surprisingly sharply defined, and is indicated bydashed lines in Fig. 1.

As the doping is decreased yet further, a non-Fermi-

liquid regime appears on the hole doping side but noton the electron doping side (for the moderate anisotropyconsidered here). In the non-Fermi-liquid regime, re-gions of momentum space near (0,�)/(�, 0) acquire aninteraction-induced gap, while the zone diagonal regionsof momentum space remain gapless and (as far as can bedetermined) Fermi-liquid like. We refer to this regime asthe sector selective regime. The boundary between theregime of momentum space di�erentiation and the sec-tor selective regime is indicated by a light solid line inFig. 1. Finally at doping n = 1 the system is in the Mottinsulating phase.

The remainder of the paper is organized as follows. Insection II we summarize the general features of the dop-ing driven Mott transition, define the model to be studiedand the questions to be considered and outline the theo-retical approach. In section III we demonstrate the exis-tence of di�erent doping regimes and how they appear inthe di�erent cluster calculations. Section IV explores inmore detail the intermediate “momentum space di�eren-tiation” doping regime, studies the momentum-selectiveregime, and aspects associated with the pseudogap. Sec-tion V then considers the sector selective regime. In sec-tion VI we summarize our insights into the behavior ofsmaller size clusters. Finally, section VII is a summaryand conclusion, also pointing out directions for futurework.

II. MODEL AND METHOD

In conventional electronic structure theory, band insu-lators are periodic crystals in which all electronic bandsare either filled or empty. A necessary condition for bandinsulating behavior is that the number of electrons perunit cell is even. For the purpose of this paper we definea correlation-induced or “Mott” insulator as a periodic

Hettler et al. ’98, ...

Goal: unify both pictures

… in the simplest way

Capture Mott physicsDMFT: local physics

Capture long-ranged bosonic fluctuationsSpin fluctuation theory

with a control parametercluster size

Real space clusters (C-DMFT)

Lichtenstein, Katsnelson 2000Kotliar et al. 2001

• Clusters = a systematic expansion around DMFT.

• Control parameter = size of cluster / momentum resolution.Systematic benchmarks, cf J. LeBlanc et al., PRX 5 (2015)

Cf lecture by D. Sénéchal

Page 25: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Beyond DMFT

• Mix diagrammatic approximations, e.g. Eliasberg or spin-fluctuation theory, Bethe Salpeter equation, Parquet equations with local atomic (Mott) physics à la DMFT. Dual fermions/bosons. Rubtsov ’08,’12, DΓA Toschi ’07, Trilex, T. Ayral, O.Parcollet, 2015-2016

• Study, compare these methods.

• Need to assemble more complex objects : G(k,ω), Vertex Γ(ω,ν,ν’).

25

G

W spW sp

Σ(k, iω) ≈

Page 26: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Need for a library

• No “general” DMFT code.

• Same for other approaches (e.g. DMRG)

• I want a simple language able to write all of these, and much more.

• Even variants which you have not yet invented !

• Hence an open approach : a library Extending Python/C++ to express the basic concepts of our field (Green functions, impurity solvers, ...).

26

Page 27: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Reproducibility

• Methods & algorithms are more and more complex

• Do we have all the elements to reproduce easily a paper ?Do we really do “Reproducible Science” ?

• Tools :

• Jupyter/IPython notebook: a simple tool for reproducibility

• Analysis script in the notebook, with text, latex formula.

• A new kind of “paper” where the script from the raw data to the figure is provided, can be changed, reanalyzed.

• Version control (GitHub)

• But the problem is deeper than that...

27

Page 28: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Status of numerics

• Numerical & analytical computations on the same footing.

• Algorithmic Physics : study algorithms e.g. for many-body problem.

• Scientific method requires openness as for analytical computations.

• Codes should be published along with papers.

• Therefore they should be written to be read !

• Code review by peers. Improvements, reuse.

• In practice, not the case: writing/testing a code is long, costly

• Need efficient open source toolkits to quickly build computations, enable team work on codes, code review.

28

Page 29: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

29

The TRIQS project Goals and organization

Page 30: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

TRIQS goals

• Basic blocks for many-body calculations, starting with DMFT and co.

• Simplicity : what is simple should be coded simply !

• High performance :

• Human time : reduce the cost of writing codes.

• Machine time : run fast.

30

Page 31: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

TRIQS project : a modular structure31

CTHYBImpurity solver

TRIQS libraryThe basic blocks

DFTToolsInterface to electronic structure

codes

Your app.

Page 32: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Python/C++

• Python

• Script language, easy to learn.

• High level part of the code (e.g. assemble a DMFT computation)

• Data analysis with the same objects/languageipython notebook

• Glue with other codes (e.g. electronic structure codes)

• C++

• Computational intensive part, e.g. quantum impurity solvers (CTHYB, CTINT). When Python is too slow.

32

Page 33: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

TRIQS Python and C++ layers.33

TRIQS library

c++

pyt h

onpy

t hon

pyc+

+ c++

dft_tools cthyb

Green's functions, arrays, expressions, Monte-Carlo tools ...

Green's functions, plotting tools ..

c++2py

C++ app....

Page 34: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

TRIQS: different levels of usage.

• Simplest usage

• Take an existing template script, e.g. our DMFT computation, change parameters, run, plot, do physics ...

• With Python programming [THIS LECTURE & HANDS-ON]

• Build your own DMFT self-consistency, using building blocks in Python, package solvers.

• With C++ programming

• Use the C++ layer to develop a high-performance application.

• Use the TRIQS tools to wrap it in Python and collaborate using Python as a common language.

34

Page 35: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

35

TRIQS library.

Olivier Parcollet, Michel Ferrero, Thomas Ayral, Hartmut Hafermann, Igor Krivenko, Laura Messio, Priyanka SethComp. Phys. Comm. 196, 39 (2015), arXiv1504.01952

Page 36: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Main developers & contributors 36

Thomas Ayral Priyanka Seth

Michel Ferrero

Igor Krivenko

O. Parcollet

Page 37: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

TRIQS library: Python 37

• Many-body operators to write Hamiltonians.

• Simple Bravais Lattices, Brillouin zone, density of states, Hilbert transform.

• Interfaces to save/load in HDF5 files, plot interactively in the ipython notebook.

Matsubara time Matsubara frequencies Real frequenciesReal time

• Various kinds of Green functions and the associated functions.

Page 38: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

TRIQS library: C++

• More libraries components:

• “Green functions” containers (any function on a mesh) G(ω), G(k,ω), Vertex Γ(ω,ν,ν’).

• Generic Monte Carlo class & error analysis tools.

• Determinant manipulations (for QMCs).

• Lattice tools: Bravais Lattices, Brillouin zone, ....

• Many-body operators.

• Basic blocks and tools , e.g.

• Multidimensional array class

• HDF5 light interface in C++

38

Page 39: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

HDF5 file format ... 39

A = HDFArchive("dmft_bethe.h5",'r') # Open filefor it in range(21): if it%2: oplot(A['G%i'%it], 'o', mode="I", name='G%i'%it) # Plot every second result

DMFT convergence

Page 40: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

HDF5 file format

• Standard file format used by many projects, e.g. pytables, ALPS.

• Language agnostic (python, C/C++, F90).

• Binary format hence compact, but also portable.

• Dump & reload objects in one line.Forget worrying about format, reading files, conventions.

• G(ω)(n1,n2) a 3d array of complex numbers, i.e. 4d array of reals. No natural convention in a 2d text file.

• Also used by ALPS projectIn progress : “standardize” details for even simpler data exchange between TRIQS & ALPS.

40

Page 41: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

41

TRIQS/CTHYB.

A Continuous-Time Quantum Monte Carlo Hybridization Expansion Solver for Quantum Impurity

Problems

Priyanka Seth, Igor Krivenko, Michel Ferrero, Olivier ParcolletComp. Phys. Comm. 200, 274 (2016), arXiv:1507.00175

Page 42: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Developers 42

Priyanka Seth

Michel Ferrero

Igor Krivenko

O. Parcollet

Page 43: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

TRIQS/CTHYB 43

https://triqs.ipht.cnrs.fr/1.x/applications/cthyb/

Page 44: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

CT-HYB :Expansion in hybridization 44

• Expansion in hybridization :

Se� = �� �

0c†a(⇤)G�1

0ab(⇤ � ⇤ ⇥)cb(⇤ ⇥) +� �

0d⇤Hlocal({c†a, ca})(⇤)

G�10ab(i⌅n) = (i⌅n + µ)�ab ��ab(i⌅n)

P. Werner et al, PRL (2006)

Z =⇧

n⇤0

<

n⌃

i=1

d�id� ⌅i⇧

ai,bi=1,N

det1⇥i,j⇥n

��ai,bj (�i � � ⌅j)

⇥Tr

⇤T e��Hlocal

n⌃

i=1

c†ai(�i)cbi(�

⌅i)

⌦ � ↵w(n, {ai, bi}, {�i})

Gab(⇥) =1Z

�Z

��ba(�⇥)

a,b = 1,N

Determinant manipulations Atomic

correlators

Page 45: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Key features of TRIQS/CTHYB

• Treat general Hamiltonian, not only density-density interaction.≠ “segment picture code”

• New ‘auto-partitioning’ algorithm divides the impurity Hilbert space efficiently without quantum numbers, i.e. no additional user input.

• Use balanced tree (Gull 2008) and truncations on it (Yee, Sémon et al.2014) for atomic correlators. Much better scaling at low T

45

Tim

e pe

r ite

ratio

n

3 e− in 5 bands, Bethe lattice

Page 46: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Many-body operators

• Write Hamiltonian (or any operator) in a natural way, as polynomials of c, c+.

• Simple manipulation of fermionic second quantized operators with normal ordering and (basic) simplifications, Cf Tutorial.

• Part of TRIQS library.

46

from pytriqs.operators.operators import Operator, n, c_dag, c

# Spin operatorsSp = c_dag("up",0)*c("dn",0) # S_+Sz = 0.5*(n("up",0) - n("dn",0)) # S_zS2 = Sz*Sz + (Sp*Sm + Sm*Sp)/2 # S^2

# The Hamiltonian of a half-filled Hubbard atomU = 1.0H = U*(n("up",0) - 0.5)*(n("dn",0) - 0.5) - U/4

Page 47: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Write more complex local Hamiltonians

• Corresponding code

47

• Atomic hamiltonian (impurities) can becomes quite complex, e.g.

H =1

2

X

ijkl,��0

Uijkld†i�d

†j�0dl�0dk�

from pytriqs.operators import Operator, c, c_dagspin, orb = [‘up’,‘down’], [‘d0’,’d1’,’d2’,’d3’,’d5’]

H = Operator()for s1, s2 in product(spin, spin): for a1, a2, a3, a4 in product(orb, orb, orb, orb): U = U_matrix[orb.index(a1),orb.index(a2), orb.index(a3),orb.index(a4)] H += 0.5 * U * c_dag(s1,a1) * c_dag(s2,a2) * c(s2,a4) * c(s1,a3)

• H is an input of the CTHYB solver

Page 48: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Features of TRIQS/CTHYB

• Four-operator insert/delete ensure ergodicity of common Hamiltonians (e.g. Kanamori), even in disordered phases (≠ Sémon et al. 2014)

48

Ergodicity: restoration using higher-order moves

First reported for broken-symmetry cases (Semon et al., 2014), butoccurs more generally!

Page 49: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

49

TRIQS/DFTTools.

Interface to electronic structure codes

Markus Aichhorn, Leonid Pourovskii, Priyanka Seth, Veronica Vildosola, Manuel Zingl, Oleg E. Peil, Xiaoyu Deng, Jernej Mravlje, Gernot J. Kraberger, Cyril Martins, M. Ferrero, O. ParcolletComp. Phys. Comm. 204, 200 (2016), arXiv:1511.01302

Page 50: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

TRIQS / DFTTools

• Ab-initio DMFT + DFT. Cf lectures by Kotliar & Haule next week. Not covered in these hands-on.

• A TRIQS python interface with a growing number of electronic structure codes:

• Wien2k

• Wannier90

• Vasp (in progress, to be published).

• Fleur

50

Figure 3: Real-space representation of the vanadium t2g Wannier function of SrVO3.Left plot: projection only to t2g bands. Right plot: projection to all vanadium d andoxygen p bands. The blue and red colours indicate the negative and positive phases,respectively, of the Wannier function. Note the much better localisation of the d-likeWannier functions in the latter case, without weight around the oxygen positions. TheWannier functions are constructed using the dmftproj program, their real-space repre-sentations are generated with the help of the wplot program from the wien2wannier [10]package. Plots are produced using XCrysDen [26].

Wannier functions:

Pα,σmν (k) =

!

α′m′

Sα,α′

m,m′"Pα′,σm′ν (k) (4)

"Pα,σmν (k) = ⟨χα,σ

m |ψσkν⟩, ν ∈ W (5)

These projectors can now be used to calculate, e.g., the local projected non-interactingMatsubara Green’s function from the DFT Green’s function,

G0,αmn(iωn) =

!

k

!

ν

Pαmν(k)

1

iωn − εkν + µPα∗nν (k), (6)

where we have dropped the spin index for better readability. Note that throughoutthe paper we assume a proper normalisation of the momentum sum over k in the firstBrillouin zone, i.e.

#k1 = 1. From this non-interacting Green’s function one can

calculate the density of states. As an example, we show in Fig. 2 the DOS for theprototypical material SrVO3. Three different Wannier constructions are displayed. First,a projection where only the vanadium t2g bands are taken into account is shown in black.The projection that comprises vanadium t2g as well as the oxygen p bands is shown inred, and the green line is the DOS for a projection using DFT bands up to 8 eV. Thedifference in the latter two projections is minor, and consists primarily in the smalltransfer of weight to large energies around 7 eV.

In Fig. 3 we show the real-space representation of the Wannier charge density. Theleft plot shows a t2g-like Wannier function for a projection of t2g bands only, whichcorresponds to the black line in Fig. 2. The right plot is the corresponding Wannier

6

SrVO3

Page 51: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Developers & some contributors 51

Manuel Zingl

Priyanka SethMichel Ferrero

Markus AichhornLeonid Pourovskii

Jernej Mravlje

Veronica Vildosola

Gernot Kraberger Oleg Peil

Page 52: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

52

Web sites

Page 54: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Documentation

• Python & C++. Mainly reference doc, with examples.

• Python tools: sphinx, rst (wiki + code + latex), automatic doc.

54

Page 55: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

The Github site

• SHOW

55

https://github.com/TRIQS

Page 56: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

How to contribute ?

• We are still a small team, help is welcome, in various ways

• Cite TRIQS papers if you used some parts of it.

• Issue reporting.

• Short contribution : “pull request” on github

• Larger contribution : coordinate with the developers.

56

Page 57: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Bug reporting

• When a problem is found in the library :bugs, bad or unnatural behavior (API), speed issue, lack of doc.Then :

• Try to narrow the problem, with a little test for us to reproduce.

• Open an issue on github.

• “It does not work” is not a bug report, it is useless.

• We will make a little exercise in hands-on #2

• We then fix the problem at its source (bug, design flaw) and add a non regression test.

57

Page 58: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

58

TRIQS library for C++ programmers

The core of the TRIQS project

A few highlights

Page 59: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Zero cost abstraction

• What is simple should be coded simply

• Code should be as simple as math, high level and yet fast.

• High abstraction and speed.

• Contrary to a common wrong idea, it is possible.

• Let’s illustrate this with 2 examples

59

Page 60: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

// A Brillouin zone of a Bravais lattice auto bz = brillouin_zone{bravais_lattice{{{1, 0}, {0, 1}}}}; // A Green function G(k,omega) double beta = 10; auto g_k_iw = gf<cartesian_product<brillouin_zone, imfreq>>{ {{bz, 100}, {beta, Fermion}}, {1, 1} };

clef::placeholder<0> iw_; // Dummy variables clef::placeholder<1> k_;

g_k_iw(k_, iw_) << 1 / (iw_ - 2*t*(cos(k_(0)) + cos(k_(1))) - 1 / (iw_ + 2));

C++ example with a Green function

• A Green function in Matsubara frequency, on a Brillouin zone.

60

• Loops are implicit, optimized, with proper memory traversal, ...

• C++ code snippet

G(k, i!n

) =

1

i!n

� 2t�cos(k

x

) + cos(ky

)

�� 1

i!n

+ 2

meshmatrix size

Page 61: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Lazy assignment techniques

• More complex example (from a real code in my group).

61

for two sets of parameters {xi

} and {yj

} of equal length. The problem consists in quicklyupdating M and its inverse M

�1 following successive insertions and removals of one ortwo lines (labelled by x

i

) and columns (labelled by y

j

) using the Sherman-Morrison andWoodbury formulas [17, 18].

This generic algorithm is implemented in the TRIQS det_manip class, using BLASLevel 2 [19, 20] internally. The class provides a simple API, in order to make thesemanipulations as straightforward and e�cient as possible.

For optimal e�ciency within a Monte Carlo framework, the modifications to thematrices can be done in two steps: a first step which only returns the determinant ratiobetween the matrix before (M) and after the modification (M 0), i.e. ⇠ = detM 0

/ detM(which is generally used in the acceptance rate of a Metropolis move) and a second stepwhich updates the matrix and its inverse. This computationally more expensive stepis usually done only if the Monte Carlo move is accepted. An example of this class isemployed is the CT-INT solver discussed in Appendix A.

8.5. CLEF (C++)

CLEF (Compile-time Lazy Expressions and Functions) is a component of TRIQSwhich allows one to write expressions with placeholders and functions, and to writequick assignments. For example, the following – quite involved – equation

0��

0

⌫⌫

0!

= �(g0�

g

0�

0

0 �

!

� g

0�

g

0�

⌫+!

⌫⌫

0�

��

0) (5)

can be coded as quickly as (variables with underscores denote placeholders)

chi0(s_ , sp_)(nu_ , nup_ , w_) <<beta * (g[s_](nu_) * g[sp_](nup_) * kronecker(om_))

- beta * (g[s_](nu_) * g[s_](nu_ + om_)* kronecker(nu_ , nup_) * kronecker(s_ , sp_ ));

This writing is clearly much simpler and less error-prone than a more conventional five-fold nested for-loop. At the same time, these expressions are inlined and optimisedby the compiler, as if the code were written manually. The library also automaticallyoptimises the memory traversal (the order of for loops) for performance based on theactual memory layout of the container chi0.

The CLEF expressions are very similar to C++ lambdas, except that their variables arefound by name (the placeholder) instead of a positional argument (in calling a lambda).This is much more convenient for complex codes.

The precise definition of the automatic assignment is as follows. Any code of the form(e.g. with three placeholders):

A(i_ ,j_ ,x_) << expression;

where expression is an expression involving placeholders3 is rewritten by the compileras follows:

triqs_auto_assign(A, []( auto& i,auto& j,auto& x) {

return eval(expression , i_=i, j_=j, x_=x);}

);

3For a precise list of what is allowed in expressions, the reader is referred to the reference documen-tation.

13

• Express intent, leave the details to the compiler & library writer.

• Save 5 loops, no need to think about bounds, memory traversal order.

• Easy parallelization, like parallel_foreach, gpu_foreach (TBB, AMP, ...)

chi0(s_, sp_)(nu_, nup_, om_) << beta * (g[s_](nu_) * g[sp_](nup_) * kronecker(om_)) - beta * (g[s_](nu_) * g[s_](nu_ + om_) * kronecker(nu_, nup_) * kronecker(s_, sp_));

• C++ code snippet

Page 62: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

CT-INT

• A demo code given with the TRIQS paper.

• A full C++ implementation for CT-INT, for 1 band.

• Parallel (MPI), with its Python interface.

• Illustration of the use of TRIQS C++ lib, 200 lines of C++.

[email protected]:TRIQS/ctint_tutorial.git

62

Page 63: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

63

Gluing Python and C++

Page 64: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

How to efficiently glue C++ & Python ? 64

TRIQS library

c++

pyt h

onpy

t hon

pyc+

+ c++

dft_tools cthyb

Green's functions, arrays, expressions, Monte-Carlo tools ...

Green's functions, plotting tools ..

c++2py

C++ app.• Issue: pass objects Python ↔ C++(e.g. Green’s functions, slices of them)

• It is critical for the TRIQS project.

• Not an easy problem in software engineering. Python & C++ are quite different.

• TRIQS solution : c++2py

• In most cases, it is entirely automatic.

• Takes C++ code, extract the functions, classes, their documentation (thanks to libClang & Google compiler team !) ...

• ... write glueing code, the documentation

Page 65: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

65

Questions ?

Let us start the hands-on ...

Page 66: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Hands on: the menu 66

Page 67: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Practical details

• TRIQS and apps are already installed on the server

• Everyone run his/her own ipython on one core on the server.

• Launch a ipython on a node (with 6h time limit). qsub /soft/bin/run_jupyter

• Find the node attributed to you more ~/jupyter_url.txt

> Starting jupyter sesion on https://10.0.XXX.XX:YYYY

• Clone locally the tutorials (local copy of https://github.com/TRIQS/tutorials.git) git clone /soft/public_soft/triqs/src/tutorials tutorials

• Open browser at https://10.0.XXX.XX:YYYYYou need to reenter your password.

• At end, qdel job_id your ipython job (use qstat to the job id).

67

Page 68: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Safari on OS X 68

Page 69: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

Safari on OS X 69

+ password to change Keychain Access

Page 70: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

In the browser, you should see something like

• Click on tutorials, then python

70

Page 71: TRIQS A Toolbox for Research in Interacting Quantum Systems€¦ · Outline • Start with an example : 1 band DMFT with CT-INT QMC as an impurity solver. • Overview of the TRIQS

71