cmsi計算科学技術特論c (2015) alps と量子多体問題①

51
CMSI C (2015/10/01) ALPS / / NIMS [email protected]

Upload: computational-materials-science-initiative

Post on 12-Jan-2017

82 views

Category:

Science


3 download

TRANSCRIPT

Page 1: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

CMSI C (2015/10/01)

ALPS

/ / NIMS [email protected]

Page 2: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

- ( )

• 1968

• 1996 Ph.D [ ( ) ]

• 1996 ( & )

• 2000 (Zürich)

• 2002

• 2011 ( )

• 2014

• ( ) NIMS ( )

• •

2

Page 3: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

CMSI C

• •

• •

• • • •

3

Page 4: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

CMSI C (1/2)

• (A) • A-1  • A-2  ( ) • A-3  ( ) ( )

• (B)  • B-1  • B-2 

• (C)  • C-1  • C-2  • C-3  ( ) • C-4  • C-5  • C-6 

4

Page 5: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

CMSI C (2/2)

• (D)  • D-1  • D-2  • D-3  • D-4  • D-5 

• (E)  • E-1  • E-2  • E-3  • E-4 

• (F) 

5

Page 6: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

CMSI C

• 10 1 10 8 : ALPS ( )

• 10 15 10 22 : OpenMX DFT ( )

• 10 29 : xTAPP DFT (RIST)

• 11 5 : ( )

• 11 12 : ( )

• 11 19 : ( ) ( )

• 11 26 12 3 : feram ( )

• 12 10 12 17 : MODYLAS MD ( )

• 1 7 1 21 : ( )

• 1 14 : SMASH ( )6

Page 7: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

ALPS Agenda (1/2)

• CMSI C

• ALPS (Applications and Libraries for Physics Simulations) ?

• ?

• ALPS

• ALPS

• ALPS

• XML / HDF5

• C++

• Python

9

Page 8: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

ALPS Agenda (2/2)

• ALPS

• ALPLS

• (GUI )

• ( )

• (MateriApps MateriApps LIVE!)

• ?

10

Page 9: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

CMSI C (2015/10/01)

ALPS

:

“ ” ALPS 70, 275-282 (2015)

Page 10: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

ALPS

• ALPS = C++

• ALPS = : QMC

DMRG ED DMFT

• ALPS =

ALPS = Algorithms and Libraries for Physics Simulations

Parameter XML Files

Outputs in XML Format

Quantum Lattice Model

Quantum Monte Carlo Exact Diagonalization DMRG

Lattice XML File Model XML File

12

Page 11: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

(Quantum Lattice Models)

• (XXZ )

• Hubbard (fermionic / bosonic)

• t-J

H = −t!

⟨i,j⟩σ

(c†iσcjσ + h.c.) + U!

i

ni↑ni↓

H =Jxy

2

!

⟨i,j⟩

(S+i S−

j + S−i S+

j ) + Jz!

⟨i,j⟩

Szi Sz

j

H = −t!

⟨i,j⟩σ

(c†iσcjσ + h.c.) + J!

i,j

(Si · Sj − ninj/4)

13

Page 12: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

?

• :

• •

• DMRG DMFT

14

Page 13: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

QLM

• (Householder ) Lanczos

• Metropolis etc

• etc

• DMRG

• DMRG ( ) (i)TEBD (i)PEPS MERA etc

• QMC etc

15

Page 14: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

ALPS

• /

• (non-portable )

16

Page 15: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

• •

• · · ·

17

Page 16: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

ALPS

• 1994 • PALM++ C++ DMRG

• 1997 • looper ( )

• 2001 ~• SSE

• 2001 • ALPS

• 2002 • 1

• 2004 • ALPS 1.0 1

• 2015 1.3

18

Page 17: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

: Spin ladder material Na2Fe2(C2O4)3(H2O)2

• Fe2+ ions in octahedral crystal field effective S=1 spins at low T

• Fitting experimental data by QMC results for several theoretical models (ladders, dimers, etc)

2.2 Experimental methodsThe magnetic susceptibilities of a single crystal of SIO

were measured at 100Oe with a superconducting quantuminterference device (SQUID) magnetometer (QuantumDesign MPMS-XL7). High-field magnetizations in pulsedmagnetic fields up to about 53 T were measured utilizing anon-destructive pulse magnet, and the magnetizations weredetected by an induction method using a standard pick-upcoil system.

ESR measurements on a single crystal of SIO in pulsedmagnetic fields up to about 53 T were carried out using ourpulse field ESR apparatus equipped with a non-destructivepulse magnet, a far-infrared laser, and several kinds of GunnOscillators for the frequency range from about 50GHzto about 1.6 THz. We also performed ESR measurementsof SIO in static magnetic fields up to 14 T utilizing asuperconducting magnet (Oxford Instruments) and a vectornetwork analyzer with some extension (ABmm). All theexperiments were carried out at KYOKUGEN in OsakaUniversity.

2.3 Calculation methodsThe quantum Monte Carlo (QMC) method used in this

calculation is coded on the basis of a continuous-time loopalgorithm, which is one of the most efficient methods forsimulating quantum spin systems. The linear size along thechain L is 64 in the present case, and we adopt a periodicboundary condition in this direction, i.e., S!;iþL ¼ S!;i, whereS!;i is the spin operator at site i on the !th chain (! ¼ 1; 2). Inaddition, it is ascertained that there is no size dependence.Details of the algorithm are given in refs. 13 and 14.

The density matrix renormalization group (DMRG)method used here is an infinite system size algorithm atT ¼ 0. However, a conventional infinite-system method withthe total-Sz quantum number cannot be used and often failsin the convergence of iterations, since the external fielddirections in our experiments are different from the principalaxes. Therefore, we employ the improved algorithm basedon the matrix product representation of the DMRG wave-function to obtain highly accurate magnetization process-

es.15,16) Note that the maximum number of retained basesm is up to 50, with which sufficient convergence of themagnetization curve can be confirmed.

3. Results

Figure 2 shows the temperature dependences of themagnetic susceptibilities for H k a ("k) and H ? a ("?).They show a broad peak at about 25 and 20K, respectively.The peak "k is about three times larger than the peak "?,which indicates a large anisotropy. In addition, although "?shows a slight decrease with decreasing temperature belowabout 20K, "k shows an upturn below about 5K.

Figure 3 shows the magnetization processes at 1.3K inmagnetic fields up to about 53 T for H k a (Mk) and H ? a(M?). For H k a, magnetization increases gradually up toabout 5 T, then shows a steep increase up to about 10 T. Onthe other hand, for H ? a, it shows a gradual increase upto the saturation magnetization of approximately 30 T. Thelinear magnetization above the saturation field with almostidentical slopes in both directions could be attributed to theVan Vleck paramagnetism, whose susceptibility is estimatedto be about 0.01 #B/(Fe2þ#T) (¼ 0:011 emu/mol). Thisvalue is almost the same as that of RbFeCl3.17) For anisolated antiferromagnetic Heisenberg dimer formed byneighboring ions on a rung, a steplike change in magnet-ization due to level crossing is expected to be observed in

a

bc

C

O

Fe

b

c

a

bc

(a)

(c)

(b)

Fig. 1. (Color online) (a) Crystal structure of Na2Fe2(C2O4)3(H2O)2.Hydrogen and sodium atoms are omitted for clarity. Fe2þ ions areconnected by oxalate molecules and form two-leg ladders along thea-axis, as shown by red broken lines. (b) Distorted FeO6 octahedrabridged by oxalate ion. (c) Arrangement of the ladders in the bc-plane,and red broken lines corresponding to rungs of the ladders.

0.20

0.15

0.10

0.05

0.00

Susc

eptib

ility

(em

u/m

ol)

100806040200Temperature (K)

H = 100 Oe

H//a

H⊥a

Fig. 2. Temperature dependences of magnetic suceptibilities of Na2Fe2-(C2O4)3(H2O)2 at H ¼ 100Oe for H k a and H ? a.

5

4

3

2

1

0

Mag

netiz

atio

n (µ

B/io

n)

6050403020100Magnetic field (T)

H// a

H⊥ a

T = 1.3 K

Fig. 3. Magnetization curves of Na2Fe2(C2O4)3(H2O)2 at 1.3K for H k aand H ? a.

J. Phys. Soc. Jpn., Vol. 78, No. 12 H. YAMAGUCHI et al.

124701-2

each direction. We suggest two possible origins of thegradual increase in M?. One is the existence of inter-dimerinteractions, namely, interactions along the leg direction. Theother is a mixing between a non-magnetic singlet groundstate and exited magnetic states caused by a large anisotropy.

The ESR spectra of a single crystal of SIO at 1.3 K inmagnetic fields up to about 53 T for H k a are shown inFig. 4. We observe strong and weak resonance signalsindicated by closed and open arrows, respectively, and plotthem in the frequency–field diagram, as shown in Fig. 5.

4. Analyses and Discussion

4.1 Two-leg ladder modelIt is well known that the lowest three states of the Fe2þ ion

in an octahedral crystal field are well separated from theother excited states owing to the crystal field and spin–orbitcoupling. Thus, the magnetic properties of Fe2þ can often bedescribed by a fictitious spin S ¼ 1 with anisotropic g valuesand exchange interactions at low temperatures.18,19) In thiscase, the spin Hamiltonian of a two-leg ladder model iswritten as

H ¼ J1X

i

ðSz1;i $ Sz2;i þ !Sy1;i $ S

y2;i þ !Sx1;i $ S

x2;iÞ

þ J2X

i

X

"

ðSz";i $ Sz";iþ1 þ !Sy";i $ S

y";iþ1 þ !Sx";i $ S

x";iþ1Þ

þX

i

X

"

#BS";i ~ggH; ð1Þ

where the inter- and intrachain exchange constants are J1and J2 (J1, J2 > 0, antiferromagnetic), respectively, ! < 1the anisotropy constant, assuming identical ! values are usedfor not only the x- and y-components but also the intra- andinterchain interactions, #B the Bohr magneton, ~gg the g-tensor, and H the external magnetic field. We define R asR ¼ J2=J1. The diagonal components for the principal axesof the g-tensor are gx, gy, and gz, and the off-diagonalcomponents are zero. We consider that the a-axis of the SIO,similarly to that of SCO, is tilted from the magnetic principalaxes.8) We define the angles between the a-axis and theprincipal axes as shown in Fig. 6(a).

Figures 6(a) and 6(b) show the calculated results ofmagnetic susceptibilities and magnetizations obtained by

Tran

smis

sion

(arb

.uni

ts)

50403020100

Magnetic Field (T)

1623.6 GHz

1288.1 GHz

977.2 GHz

847.0 GHz

730.5 GHz

693.5 GHz

655.7 GHz

T=1.3 K

H//a

584.8 GHz

Fig. 4. (Color online) ESR spectra of Na2Fe2(C2O4)3(H2O)2 at 1.3K forH k a. The closed and open arrows indicate the strong and weak signals,respectively.

1600

1400

1200

1000

800

600

400

200

0

Freq

uenc

y (G

Hz)

35302520151050Magnetic Field (T)

T =1.3 K

strong signalweak signalcalculation

H//a

2

5

1

3

4

Fig. 5. (Color online) Frequency-field diagram of the resonance fieldsof Na2Fe2(C2O4)3(H2O)2 for H k a. Closed circles and open trianglesdenote strong and weak signals, respectively. The solid lines indicate theresonance modes calculated from the energy diagram shown in Fig. 8.

y

z

x

a

0.20

0.15

0.10

0.05

0.00

Susc

eptib

ility

(em

u/m

ol)

30252015105Temperature (K)

H// a

H⊥ a

H = 100 Oe experiment

R=0.1, J1/kB=26 K R=0.3, J1/kB=21 K R=0.5, J1/kB=17 K

(a)

(b)

experiment T=1.3 K

4

3

2

1

0

Mag

netiz

atio

n (µ

B/io

n)

403020100Magnetic Field (T)

H// a

H⊥ a

24° y

z

Fig. 6. (Color online) (a) QMC calculations of magnetic susceptibility fordifferent ratios of R. The illustration shows the relation between the a-axisand the principal axes. (b) DMRG calculations of magnetization processfor different ratios of R. The illustration shows the relation between the Feladder and the principle axes. The z-axis is nearly perpendicular to therung of the ladder. In both figures, the open diamonds, open circles, andopen squares represent the calculated results for R ¼ 0:1, 0.3, and 0.5,respectively.

J. Phys. Soc. Jpn., Vol. 78, No. 12 H. YAMAGUCHI et al.

124701-3

the QMC and the DMRG methods, respectively. Forthese calculations, we use the following parameter values,gz ¼ 4:7, gx ¼ 2:0, gy ¼ 2:5, ! ¼ 0:30, and R ¼ 0:1{0:5 forH k a (" ¼ 24", ’ ¼ 90") and H ? a (" ¼ 102", ’ ¼ 45").The principal axis directions and their g-values are deter-mined from the saturation magnetizations and the slopes ofthe ESR resonance modes in the following isolated dimermodel analysis. In these field directions, the two sites of theladder are magnetically equivalent. In the calculation, weadd the temperature-independent Van Vleck paramagnetismto both #k and #?. The calculated results do not reproducethe experimental ones well, especially the upturn of #kat approximately 5K. In Fig. 6(b), the Van Vleck para-manetic contributions are subtracted from both Mk and M?.We find a small anomaly at half of the saturation magnet-ization of R ¼ 0:1 calculated for H k a, which can beconsidered to originate from a 1/2 magnetization plateau.The calculated results also poorly explain the experimentalones, particularly the steep change in Mk at approximately5 T.

4.2 Isolated dimer modelIn this section, we analyze the experimental results of SIO

in terms of an isolated dimer model by taking into accountnot only the anisotropy of the exchange interactions butalso single-ion anisotropies (D and E). Then, the spinHamiltonian is expressed as

H ¼ J1ðSz1Sz2 þ !Sx1S

x2 þ !Sy1S

y2Þ þ D

X

$

ðSz$Þ2

þ EX

$

½ðSx$Þ2 ' ðSy$Þ

2( þX

$

%BS$ ~ggH: ð2Þ

As shown in Fig. 7, we obtain good agreement between theexperimental and calculation results using the followingparameters, J1=kB ¼ 20K, ! ¼ 0:20, D=kB ¼ '22K, andE=kB ¼ 4:8K. The g-values and the angles " and ’ are thesame as those in the case of the two-leg ladder model, andVan Vleck paramagnetic contributions are also considered.We confirmed that these anisotropic parameters are almostconsistent with theoretical evaluations for the Fe2þ ion in anoctahedral field based on the crystal field theory.19) Such alarge anisotropy was also reported for several compoundswith Fe2þ ions.20) These results well reproduce the upturn of#k at approximately 5K and the steep change in Mk at about5 T. The slight deviations in the magnetic susceptibilities inthe higher-temperature region are considered to be contrib-uted by higher excited states with different effective totalangular momenta, which is not included within the frame-work of the fictitious spin 1.

Figure 8 shows the calculated energy branches for H k a.Energy levels of the dimer with S ¼ 1 are split into a quintet,a triplet, and a singlet state. We define the eigenstate asjS; Szi. However, these energy levels are strongly mixed bythe large anisotropy. We can see the mixing between thenon-magnetic singlet state j0; 0i and the exited magneticstate j2;'2i. This results in the upturn of #k and the steepchange in Mk at approximately 5 T. From the energybranches, we calculate ESR resonance modes. Since theESR measurements were conducted at a sufficiently lowtemperature of 1.3 K, only the ESR transitions from theground state are mainly observed. Taking the ESR selection

rule into account, we obtain five resonance modes, as shownin Fig. 5, which correspond to transitions from the singletground state to the quintet states indicated by arrows inFig. 8. These transitions are usually forbidden. However, themixing of the states makes them observable. The agreementbetween the experimental and calculation results is satisfac-tory, and we consider that several resonances that deviatedfrom the main resonance branches must have come from thetransitions between the exited states.

0.20

0.15

0.10

0.05

Susc

eptib

ility

(em

u/m

ol)

30252015105Temperature (K)

H = 100 Oe

H//a

H⊥aexperimentcalculation

(a)

(b)4

3

2

1

0

Mag

netiz

atio

n (µ

B/io

n)

35302520151050Magnetic field (T)

H//a

H⊥a

T = 1.3 K

experiment calculation

Fig. 7. (Color online) Comparison between the experimental and calcu-lated results obtained using an isolated dimer model for (a) magneticsusceptibilities and (b) magnetization processes.

1

25

| 0,0>

| 1,0>

| 1,-1>

1500

1000

500

0

-500

Ene

rgy

(GH

z)

20151050Magnetic Field (T)

H// a| 2,-1>

| 1,1>

| 2,0>

| 2,1>| 2,2>| 2,-2>

4

3

Fig. 8. (Color online) Calculated energy diagram for H k a. The eigen-states are given by jS; Szi. The arrows indicate allowed transitions fromthe ground state.

J. Phys. Soc. Jpn., Vol. 78, No. 12 H. YAMAGUCHI et al.

124701-4

Yamaguchi, Kimura, Honda, Okunishi, Todo, Kindo, Hagiwara (2009)19

Page 18: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

: Orbital ordering in eg orbital systems

• Mott insulators with partially filled d-shells

• Non-trivial interplay of charge, spin, and orbital degrees of freedom

• Effective Hamiltonian for orbital degrees of freedom (120o model)

|x2 � y

2i |3z2 � r2i

H120

=�X

i,�=x,y

14

hJ

z

T z

i

T z

i+�

+ 3Jx

T x

i

T x

i+�

±p

3Jmix

(T z

i

T x

i+�

+ T x

i

T z

i+�

)i�

X

i

Jz

T z

i

T z

i+z

0

0.5

1

1.5

2

orbi

ton

gap

!

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2Jx / Jz

0

2

4

Jmix

/ Jz

! ! ! !

! !

!

"#

! !

!

"#

T zpolarized

T x

polarized

(xy planes)

van Rynbach, Todo, Trebst (2010)20

Page 19: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

: Supersolid in extended Bose-Hubbard model

• Interacting soft-core bosons

• Supersolid = co-existence of diagonal long-range order (=solid) and off-diagonal long-range order (=superfluid)

• Experimental realization: optical lattice?

II. MODEL

We analyze the extended Bose-Hubbard Hamiltonian on acubic lattice

H = − t!"ij#

$ai†aj + aiaj

†% + V!"ij#

ninj

+12

U!i

ni$ni − 1% − !!i

ni, $1%

where ai† and ai are the creation and annihilation operators of

a boson $&ai ,aj†'="ij% and ni=ai

†ai. The parameter t denotesthe hopping matrix element, U and V are the on-site andnearest-neighbor repulsions, respectively, and ! is thechemical potential. The notation "ij# means the sum over thenearest-neighbor pairs. The system size is N=L3, where L isthe length of the system. The order parameter of the solidstate is

S# =1

N2!jk

eiQ·$rj−rk%"njnk# , $2%

where Q= $# ,# ,#% is the wave vector that represents thestaggered order. As for the order parameter of the superfluidstate, we adopt Bose-Einstein condensation fraction

$k=0 =1

N2!jk

"aj†ak + ak

†aj# $3%

in the mean-field analysis, while in the SSE simulation weadopt the superfluidity $s for the convenience of numericalcalculation. The expression of $s is given in Sec. III. Al-though these two quantities are not the same, both of themdescribe the off-diagonal long-range order $ODLRO% and areconsidered to represent the same qualitative nature of thesuperfluidity.

III. METHODS

We use the following two different methods to analyzeproperties of the system.

A. Stochastic series expansion

We perform numerical simulation of the SSE, which wasinvented by Sandvik.15,16 This method is one of quantumMonte Carlo $QMC% simulations and has been successfullyapplied for various quantum systems. In order to avoid theclusterization due to diagonal frustration, we adopt the gen-eralized directed loop algorithm.17 We use a package ofthe Algorithms and Libraries for Physics Simulations$ALPS%.18,19 We adopt a simple-cubic lattice of N=L3 siteswith periodic boundary conditions along all the lattice axes.In the simulation, instead of the condensation fraction $k=0&Eq. $3%', we calculate superfluidity $s using the windingnumber W of world lines20,21

$s ="W2#3t%L

, $4%

where % is the inverse temperature.

B. Mean-field approximation

We also analyze the ordering processes by the MFapproximation.22 In order to study the solid state, we use asublattice structure which is characterized by a staggered or-der of the density. Here we adopt mean fields for the solidorder and superfluid order at sublattices A and B. The Hamil-tonian for this MF is given by

HMF = HA + HB + C , $5%

HA = − zt$aA† + aA%&B + zVnAmB +

U

2nA$nA − 1% − !nA,

$6%

HB = − zt$aB† + aB%&A + zVnBmA +

U

2nB$nB − 1% − !nB,

$7%

C = 2zt&A&B − zVmAmB, $8%

where z$=6% is the number of nearest-neighbor sites. Here,mA and mB are the mean fields corresponding to the expec-tation values of the number operators for A and B sites, re-spectively,

mA = "nA# and mB = "nB# . $9%

Similarly, &A and &B correspond to the expectation values ofthe annihilation operators for A and B sites, respectively,

&A = "aA# and &B = "aB# . $10%

Here, the expectation values are taken over the ground statein the case of T=0. In the finite temperature case, these rep-resent the thermal averages.

HA $HB% is a mean-field Hamiltonian at a site of the A $B%sublattice. C is a correction term compensating the doublecounting of the energy.

In the finite temperature case, the partition function andthe free energy are given by

ZMF = Tr$e−%HMF% , $11%

FMF = −1%

ln ZMF. $12%

In MF, m($mA−mB% /2 denotes the order parameter of solidand fulfill the relation S#=m2. Similarly, &($&A+&B% /2represents the order parameter of superfluid and fulfill therelation, $k=0=2&2, according to Eq. $3%.

IV. GROUND-STATE PROPERTIES

Before analyzing properties at finite temperatures, let ussummarize the ground-state properties. As has been reported,the system may have the supersolid phase in the ground statewhen U takes a finite value.14,23 In Fig. 1, we show theground-state phase diagram in the coordinate of $t /U ,! /U%obtained by MF method. As for the supersolid state in the

YAMAMOTO, TODO, AND MIYASHITA PHYSICAL REVIEW B 79, 094503 $2009%

094503-2

II. MODEL

We analyze the extended Bose-Hubbard Hamiltonian on acubic lattice

H = − t!"ij#

$ai†aj + aiaj

†% + V!"ij#

ninj

+12

U!i

ni$ni − 1% − !!i

ni, $1%

where ai† and ai are the creation and annihilation operators of

a boson $&ai ,aj†'="ij% and ni=ai

†ai. The parameter t denotesthe hopping matrix element, U and V are the on-site andnearest-neighbor repulsions, respectively, and ! is thechemical potential. The notation "ij# means the sum over thenearest-neighbor pairs. The system size is N=L3, where L isthe length of the system. The order parameter of the solidstate is

S# =1

N2!jk

eiQ·$rj−rk%"njnk# , $2%

where Q= $# ,# ,#% is the wave vector that represents thestaggered order. As for the order parameter of the superfluidstate, we adopt Bose-Einstein condensation fraction

$k=0 =1

N2!jk

"aj†ak + ak

†aj# $3%

in the mean-field analysis, while in the SSE simulation weadopt the superfluidity $s for the convenience of numericalcalculation. The expression of $s is given in Sec. III. Al-though these two quantities are not the same, both of themdescribe the off-diagonal long-range order $ODLRO% and areconsidered to represent the same qualitative nature of thesuperfluidity.

III. METHODS

We use the following two different methods to analyzeproperties of the system.

A. Stochastic series expansion

We perform numerical simulation of the SSE, which wasinvented by Sandvik.15,16 This method is one of quantumMonte Carlo $QMC% simulations and has been successfullyapplied for various quantum systems. In order to avoid theclusterization due to diagonal frustration, we adopt the gen-eralized directed loop algorithm.17 We use a package ofthe Algorithms and Libraries for Physics Simulations$ALPS%.18,19 We adopt a simple-cubic lattice of N=L3 siteswith periodic boundary conditions along all the lattice axes.In the simulation, instead of the condensation fraction $k=0&Eq. $3%', we calculate superfluidity $s using the windingnumber W of world lines20,21

$s ="W2#3t%L

, $4%

where % is the inverse temperature.

B. Mean-field approximation

We also analyze the ordering processes by the MFapproximation.22 In order to study the solid state, we use asublattice structure which is characterized by a staggered or-der of the density. Here we adopt mean fields for the solidorder and superfluid order at sublattices A and B. The Hamil-tonian for this MF is given by

HMF = HA + HB + C , $5%

HA = − zt$aA† + aA%&B + zVnAmB +

U

2nA$nA − 1% − !nA,

$6%

HB = − zt$aB† + aB%&A + zVnBmA +

U

2nB$nB − 1% − !nB,

$7%

C = 2zt&A&B − zVmAmB, $8%

where z$=6% is the number of nearest-neighbor sites. Here,mA and mB are the mean fields corresponding to the expec-tation values of the number operators for A and B sites, re-spectively,

mA = "nA# and mB = "nB# . $9%

Similarly, &A and &B correspond to the expectation values ofthe annihilation operators for A and B sites, respectively,

&A = "aA# and &B = "aB# . $10%

Here, the expectation values are taken over the ground statein the case of T=0. In the finite temperature case, these rep-resent the thermal averages.

HA $HB% is a mean-field Hamiltonian at a site of the A $B%sublattice. C is a correction term compensating the doublecounting of the energy.

In the finite temperature case, the partition function andthe free energy are given by

ZMF = Tr$e−%HMF% , $11%

FMF = −1%

ln ZMF. $12%

In MF, m($mA−mB% /2 denotes the order parameter of solidand fulfill the relation S#=m2. Similarly, &($&A+&B% /2represents the order parameter of superfluid and fulfill therelation, $k=0=2&2, according to Eq. $3%.

IV. GROUND-STATE PROPERTIES

Before analyzing properties at finite temperatures, let ussummarize the ground-state properties. As has been reported,the system may have the supersolid phase in the ground statewhen U takes a finite value.14,23 In Fig. 1, we show theground-state phase diagram in the coordinate of $t /U ,! /U%obtained by MF method. As for the supersolid state in the

YAMAMOTO, TODO, AND MIYASHITA PHYSICAL REVIEW B 79, 094503 $2009%

094503-2

http://www.uibk.ac.at/th-physik/qo

successive transitions of superfluid and solid for !t /U=0.045,! /U=0.7". As was seen in the SSE simulation, herewe find again the suppression of the solid order by the su-perfluid fraction. Namely, S" has a cusp at the superfluidtransition point. We also depict the phase diagram and com-pare that to that of SSE !Fig. 8". They show a qualitativelygood agreement, e.g., there is the tetracritical point !tc ,Tc"and the critical temperatures TS"

and T#sare suppressed by

appearance of the other order as mentioned before.Let us study the competition between the solid and super-

fluid orders by analyzing the Ginzburg Landau !GL" freeenergy. Since the order parameters m and $ take small valuein the vicinity of the tetracritical point, the GL free energy isexpressed as

F = am2 + bm4 + c$2 + d$4 + hm2$2. !13"

When a becomes zero at TS"#a$a0!T−TS"

"% with a positiveb, the second-order transition between the normal solid andnormal liquid phases takes place, and similarly when c be-comes zero at T#s

#c$c0!T−T#s"% with a positive d, the

second-order transition between the superfluid and normalliquid phases takes place. The fifth term represents the com-

petition between the solid and the superfluid order. If hequals zero, the transition of the solid phase and that of su-perfluid take place independently at TS"

and T#s, respectively.

If h is positive, the presence of the superfluid order lowersthe transition temperature of solid. Below the tc, the solidorder emerges first as temperature decreases. Then, the su-perfluid order appears at the modified transition temperatureT#s! which is smaller than the original one

T#s! % T#s

−a0h/2bc0

1 − a0h/2bc0!TS"

− T#s" % T#s

. !14"

In the same way, the solid order lowers the transition tem-perature of superfluid. The decrease of the transition tem-peratures becomes large when h becomes large and thismeans the shrinkage of the supersolid region. Thus, h repre-sents the competition between the solid and the superfluidorders.

As a final part of this section, we discuss the effect ofon-site repulsion on the coexistence of solid and superfluidorders. As has been mentioned, the SS phase does not existin the ground-state !-t phase diagram for the hardcore casewhich corresponds to the limiting case of infinite U. There-fore we expect that the supersolidity is suppressed when theon site repulsion U becomes large. We depict the t-T phasediagram for various values of U in Fig. 9 obtained by MF.Here, we use zV as the unit of energy instead of U becausenow we want to study the effect of U. In Fig. 9, we find thatthe SS region becomes narrower as U increases. Finally, thesupersolid region disappears completely in the hardcore limitU→&, where a first-order transition between solid and su-perfluid phases takes place. Thus, we conclude that U, i.e.,the hardness of the particle, suppresses the coexistence of thetwo orders.

VI. DISCUSSION AND SUMMARY

We studied properties of supersolid state in three-dimensional extended Bose-Hubbard model by using SSEsimulation and MF analysis. First we studied the ground-state phase diagram. There we found the existence of super-solid phase in the region of #%1 /2. We confirmed that this

0

0.05

0.1

0.15

0.2

0.25

0.04 0.045 0.05 0.055 0.06

T/U

t/U

NL

SS

NS SF

TSπby SSE

Tρsby SSE

FIG. 6. The t-T phase diagram for V /U=1 /z and ! /U=0.7obtained by SSE. The transition temperatures of the solid state TS"are plotted by solid circles and those of the superfluid state T#s

areplotted by open circles. The lines connect the data points for theguide to the eyes.

0

0.05

0.1

0.15

0.2

0.25

0.3

0 0.1 0.2 0.3 0.40

0.2

0.4

0.6

0.8

1

1.2

S π ρ k=0

T/U

Sπρk=0

FIG. 7. Temperature dependence of order parameters for V /U=1 /z, t /U=0.045, and ! /U=0.7 obtained by MF. Solid line de-notes the solid order parameter and the dashed line denotes thesuperfluid order parameter.

0

0.1

0.2

0.3

0.4

0.02 0.03 0.04 0.05 0.06 0.07 0.08

T/U

t/U

NL

SS

NSSF

TSπby SSE

Tρsby SSE

TSπby MF

Tρsby MF

FIG. 8. The t-T phase diagram for V /U=1 /z and ! /U=0.7obtained by MF. The transition temperature of the solid state TS"

isdenoted by the thick solid line and that of the superfluid state T#s

isdenoted by the thick dashed line. We also depict the phase diagram!solid and open circles" obtained by SSE !Fig. 6" for comparison.

SUCCESSIVE PHASE TRANSITIONS AT FINITE… PHYSICAL REVIEW B 79, 094503 !2009"

094503-5

sity !"1 /2. Therefore we confirm the existence of the su-persolid phase in the region of !"1 /2.

V. PHASE TRANSITIONS AT FINITE TEMPERATURES

Now, we study the ordered states at finite temperatures.The phase transition between the normal liquid phase and thesolid phase is expected to belong to the universality class ofthe Ising model because the phase transition occurs in thespontaneous symmetry breaking of the order parameter withthe symmetry of Z2. On the other hand, the phase transitionof superfluid is expected to belong to the XY universalityclass because the order parameter has the symmetry of U!1".In this section, we study the temperature dependence of theseorder parameters.

A. Stochastic series expansion

First, we show the results obtained by SSE. The simula-tions were performed in the grand canonical ensemble usinga system sizes N=103 and N=123.

We plot the order parameters of solid, S#, and that ofsuperfluid, !s, as a function of temperature for various valuesof t. In Fig. 5!a", we show the transition from normal liquidto normal solid for t /U=0.02 in which only S# appears con-tinuously. In the same way, the transition from normal liquidto superfluid for t /U=0.08 is depicted in Fig. 5!b". Fort /U=0.045, the system shows successive transitions and thesupersolid state is realized at low temperatures. There, wefind that the solid order appears at a higher temperature #Fig.5!c"$. Note that the solid order is suppressed when the super-fluid order appears. Thus, we expected that the solid fractionand the superfluid fraction compete with each other. It shouldbe noted that !s appears at higher temperature than the solidorder for t /U=0.055 !not shown".

In Fig. 6, we depict a phase diagram in the coordinate of!t /U ,T /U" for the fixed values V /U=1 /z and $ /U=0.7. Thetransition temperatures of the solid state TS#

are plotted bysolid circles and those of the superfluid state T!s

are plottedby open circles. To determine the transition temperatures foreach value of t, we use the method of the Binder parameter27

of the systems with L=10 and 12. In Fig. 6, there are fourdifferent phases: NL, NS, SF, and SS. These phases meet at a

tetracritical point !tc ,Tc". The competition of solid and super-fluid orders is also found in the phase diagram !Fig. 6".Namely, above tc, the transition temperature of solid issmaller than that of smooth extension of TS#

from t" tc.Therefore we conclude that TS#

is suppressed from that ofthe case in which the superfluid would not order. Similarly,below tc, the transition temperature of superfluid is smallerthan that of the case in which the solid would not order.

B. Mean-field analysis

Here, we calculate the temperature dependence of orderparameters by making use of MF. In Fig. 7, we show the

0

0.1

0.2

0.3

0.4

0.5

0.6

0 0.02 0.04 0.06 0.08 0.1 0.12 0.14

S π,ρ

s,ρ

1/L

Sπρsρ

FIG. 4. The size dependence of the solid and the superfluidorder parameters for the parameter set !t /U=0.055,$ /U=0.25,V=U /z" calculated by SSE. System sizes are from L=8 to L=16.Dashed lines denote linear extrapolations of data points.

0

0.05

0.1

0.15

0.2

0.25

0.3

0 0.1 0.2 0.3 0.40

0.2

0.4

0.6

0.8

1

1.2

1.4

S π ρ s

T/U

Sπ(L=12)Sπ(L=10)ρs(L=12)ρs(L=10)

(a)

0

0.05

0.1

0.15

0.2

0.25

0.3

0 0.1 0.2 0.3 0.40

0.2

0.4

0.6

0.8

1

1.2

1.4

S π ρ s

T/U

Sπ(L=12)Sπ(L=10)ρs(L=12)ρs(L=10)

(b)

0

0.05

0.1

0.15

0.2

0.25

0.3

0 0.1 0.2 0.3 0.40

0.2

0.4

0.6

0.8

1

1.2

1.4

S π ρ s

T/U

Sπ(L=12)Sπ(L=10)ρs(L=12)ρs(L=10)

(c)

FIG. 5. Temperature dependence of order parameters obtainedby SSE !V=U /z". !a" !t /U=0.02,$ /U=0.7": normal liquid-normalsolid transition. !b" !t /U=0.08,$ /U=0.7": normal liquid-superfluidtransition. !c" !t /U=0.045,$ /U=0.7": normal liquid-normal solidtransition and normal solid-supersolid transition.

YAMAMOTO, TODO, AND MIYASHITA PHYSICAL REVIEW B 79, 094503 !2009"

094503-4

Yamamoto, Todo, Miyashita (2009)21

Page 20: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

ALPS

• 600 ALPS ( 2015 8 )• First-order commensurate-incommensurate magnetic phase transition in the

coupled FM spin-1/2 two-leg ladders• Critical behavior of the site diluted quantum anisotropic Heisenberg model in two

dimensions• Dimerized ground states in spin-S frustrated systems• Practical, Reliable Error Bars in Quantum Tomography• Fulde-Ferrell-Larkin-Ovchinnikov pairing as leading instability on the square lattice• Mott Transition for Strongly-Interacting 1D Bosons in a Shallow Periodic Potential• Pair Correlations in Doped Hubbard Ladders• Theoretical investigation of the behavior of CuSe2O5 compound in high magnetic

fields• FLEX+DMFT approach to the d -wave superconducting phase diagram of the two-

dimensional Hubbard model• Transport properties for a quantum dot coupled to normal leads with a pseudogap• http://alps.comp-phys.org/mediawiki/index.php/PapersTalks

22

Page 21: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

CMSI C (2015/10/01)

ALPS ( )

Page 22: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

ALPS

• XML

• ( )

• ( )

• XML

• ( ): ED CMC QMC DMRG DMFT

• ALPS

• Python

24

Page 23: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

ALPS

parameter2xmltool

application programs

Python based evaluation tools

Parameter XML File

Outputs in HDF5 & XML

Quantum Monte Carlo

Quantum Lattice Model

Exact Diagonalization DMRG

Lattice XML Filesquare lattice

<LATTICES> <LATTICE name="square lattice" dimension="2"> <PARAMETER name="a" default="1"/> <BASIS><VECTOR>a 0</VECTOR><VECTOR>0 a</VECTOR></BASIS> </LATTICE> <UNITCELL name="simple2d" dimension="2"> <VERTEX/> <EDGE> <SOURCE vertex="1" offset="0 0"/> <TARGET vertex="1" offset="0 1"/> </EDGE> <EDGE> <SOURCE vertex="1" offset="0 0"/> <TARGET vertex="1" offset="1 0"/> </EDGE> </UNITCELL> <LATTICEGRAPH name="square lattice"> <FINITELATTICE> <LATTICE ref="square lattice"/> <EXTENT dimension="1" size="L"/> <EXTENT dimension="2" size="L"/> <BOUNDARY type="periodic"/> </FINITELATTICE> <UNITCELL ref="simple2d"/> </LATTICEGRAPH></LATTICES>

(0,0)

(0,1)

(1,0)

<MODELS> <BASIS name="spin"> <SITEBASIS name="spin"> <PARAMETER name="local_S" default="1/2"/> <QUANTUMNUMBER name="S" min="local_S" max="local_S"/> <QUANTUMNUMBER name="Sz" min="-S" max="S"/> <OPERATOR name="Sz" matrixelement="Sz"/> <OPERATOR name="Splus" matrixelement="sqrt(S*(S+1)-Sz*(Sz+1))"> <CHANGE quantumnumber="Sz" change="1"/> </OPERATOR> <OPERATOR name="Sminus" matrixelement="sqrt(S*(S+1)-Sz*(Sz-1))"> <CHANGE quantumnumber="Sz" change="-1"/> </OPERATOR> </SITEBASIS> </BASIS> <HAMILTONIAN name="spin"> <PARAMETER name="J" default="1"/> <PARAMETER name="h" default="0"/> <BASIS ref="spin"/> <SITETERM> -h * Sz(i) </SITETERM> <BONDTERM source="i" target="j"> J * (Sz(i)*Sz(j) + (Splus(i)*Sminus(j)+Sminus(i)*Splus(j)))/2 </BONDTERM> </HAMILTONIAN></MODELS>

Model XML File

H = J< i,j>

[ Szi S zj + ( S+i S -j + S -i S+j )/ 2 - hiS zi]Σ Σ

Plots

Parameter FileLATTICE = "square lattice"MODEL = "spin"L = 16Jxy = 1Jz = 2SWEEPS = 10000THERMALIZATION = 1000

{ T = 0.1 }{ T = 0.2 }{ T = 0.5 }{ T = 1.0 }

DMFT

25

Page 24: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

ALPS

generic C++

numerics

domain-specificlibraries

applications

tools

C / Fortran BLAS LAPACK MPI

graph serialization XML/XSLT

iterative eigenvalue solverrandom ublas

lattice model observables scheduler

MC QMC ED DMRG DMFT

XML manipulation Python binding GUI

Boost library

26

Page 25: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

• Boost C++ Library•

• HDF5 (Hierarchical Data Format)•

• MPI (Message Passing Interface)•

• BLAS LAPACK

• ( )

27

Page 26: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

ALPS/alea

alps::RealObservable mag2("Magnetization^2");... mag2 << m * m; // at each MC step

std::cout << mag2 << std::endl;

Magnetization^2: 3.142 +/- 0.001; tau = 10.3

alps::RealObsEvaluator binder = mag2 * mag2 / mag4;std::cout << binder.mean() << ‘ ‘ << binder.error() << ‘\n’;

28

Page 27: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

ALPS/lattice

• site vertex

• bond edge

• Boost Graph Library

• XML

• “hain lattice” “square lattice” “triangular lattice” “honeycomb lattice” “simple cubic lattice”

29

Page 28: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

XML

<LATTICE name="chain lattice" dimension="1"> <BASIS><VECTOR> 1 </VECTOR></BASIS> </LATTICE>

<UNITCELL name="simple1d" dimension="1" vertices=”1”> <EDGE> <SOURCE vertex="1" offset="0"/><TARGET vertex="1" offset="1"/> </EDGE> </UNITCELL>

<LATTICEGRAPH name = "chain lattice"> <FINITELATTICE> <LATTICE ref="chain lattice"/> <PARAMETER name=”L”/> <EXTENT size ="L"/> <BOUNDARY type="periodic"/> </FINITELATTICE> <UNITCELL ref="simple1d"/> </LATTICEGRAPH>

30

Page 29: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

ALPS/model

• XML • •

• • • ALPS Model HOWTO: http://alps.comp-phys.org/mediawiki/ index.php/

Tutorials:ModelHOWTO/ja • : “spin” “boson Hubbard” “hardcore boson”

“fermion Hubbard” “alternative fermion Hubbard” “spinless fermions” “Kondo lattice” “t-J”

Jz*Sz(i)*Sz(j)+Jxy/2*(Splus(i)*Sminus(j)+Sminus(i)*Splus(j))

31

Page 30: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

XML

<HAMILTONIAN name=”spin”> <PARAMETER name=”Jz” default=”J”/> <PARAMETER name=”Jxy” default=”J”/> <PARAMETER name=”J” default=”1”/> <PARAMETER name=”Jz'” default=”J'”/> <PARAMETER name=”Jxy'” default=”J'”/> <PARAMETER name=”J'” default=”0”/> <PARAMETER name=”h” default=”0”/> <BASIS ref=”spin”/> <SITETERM site=”i”> -h * Sz(i) </SITETERM> <BONDTERM type=”0” source=”i” target=”j”> Jz * Sz(i) * Sz(j) + Jxy * (Splus(x)*Sminus(y)+Sminus(x)*Splus(y)) / 2 </BONDTERM> <BONDTERM type=”1” source=”i” target=”j”> Jz' * Sz(i) * Sz(j) + Jxy' * (Splus(x)*Sminus(y)+Sminus(x)*Splus(y)) / 2 </BONDTERM> </HAMILTONIAN>

H =!

⟨i,j⟩

[JzSzi Sz

j +Jxy

2(S+

i S−j + S−

i S+j )] −

!

i

hSzi

32

Page 31: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

• XML HDF5 • ( )• •

• C++ • •

• C++ Boost • •

• MPI + OpenMP • (Python) •

33

Page 32: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

XML

• XML eXtensible Marckup Landuage

• XML : HTML (XHTML)

an attribute

contents

empty element (no contents)

opening tag

closing tag

<html> <h1 align=”center”>Header</h1> <p>A paragraph... And below it an image</p> <img src=”img.jpg”/></html>

34

Page 33: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

XML

• •

• XML

• XML ( ) ( : Document Type Definition (DTD) XML Schema)

html

imgh1 p

align="center" A paragraph... src="img.jpg"Header

<html> <h1 align=”center”>Header</h1> <p>A paragraph... And below it an image</p> <img src=”img.jpg”/></html>

35

Page 34: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

XML ?

• ?

• ?

• ?

plain text file

# parameters10 0.5 10000 1000# mean, error-10.451 0.043

<PARAMETER name=“L”>10</PARAMETER><PARAMETER name=“T”>0.5</PARAMETER><PARAMETER name=“SWEEPS”>10000</PARAMETER><PARAMETER name=“THERMALIZATION”>1000</PARAMETER><AVERAGE name=“Energy”> <MEAN> -10.451 </MEAN> <ERROR> 0.043 </ERROR></AVERAGE>

XML file

36

Page 35: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

• XML ( )

# parameters10 0.5 10000 1000 12# RNG“lagged fibonacci”# mean, error-10.451 0.043

<PARAMETER name=“L”>10</PARAMETER><PARAMETER name=“T”>0.5</PARAMETER><PARAMETER name=“SWEEPS”>10000</PARAMETER><PARAMETER name=“THERMALIZATION”>1000</PARAMETER><PARAMETER name=”SEED”>12</PARAMETER><RNG name=”lagged fibonacci”/><AVERAGE name=“Energy”> <MEAN> -10.451 </MEAN> <ERROR> 0.043 </ERROR></AVERAGE>

37

Page 36: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

C (Fortran) vs C++

• C++ C ( )

• ( )

• (inheritance) (virtual function)

• (+ * …)

• etc...

38

Page 37: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

class Complex {public: Complex(double r, double i) { re=r; im=i; } // double real() const { return re; } // double imag() const { return im; } double abs() const { return sqrt(re*re + im*im); } Complex& operator=(const Complex& rhs) { re = rhs.re; im = rhs.im; } // Complex operator+(const Complex& c) const { return Complex(re + c.re, im + c.im); } // + // ... private: double re, im; // ( ) };

Complex a(1,0), b(0,1); // Complex a,bComplex c = a+b; cout << c.real() << ‘ ‘ << c.imag() << ‘ ‘ << c.abs; //

39

Page 38: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

• ( ) • •

• •

• • ( ) ( )

• ( )

• (or ) •

40

Page 39: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

// class Number {public: virtual double abs();};

// 1class RealNumber : public Number {public: double abs() { return val; } double val;};

// 2 class Complex : public Number {public: double abs() { return c.abs(); } Complex c;};

//

void output(Number& num) { cout << num.abs();}

RealNumber rn;ComplexNumber cn;

// ...

// RealNumber::abs()output(rn);

// ComplexNumber::abs()output(cn);

41

Page 40: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

Class/Function Template

• : ( ??)

template<class T> Complex {public: T real() const { return re; } T abs() const { sqrt(re*re + im*im); }private: T re, im;};

Complex<double> c; // T double

template<class T>T abs(const Complex<T>& c) { return c.abs();}

42

Page 41: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

• ?

• ) (bubble sort)

subroutine sort(n, a)dimension a(n)do i = n, 2, -1 do j = 1, i-1 if (a(j).lt.a(j+1)) then b = a(j) a(j) = a(j+1) a(j+1) = b endif enddo enddo

43

Page 42: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

•( )

• common

function less(i,j)logical lesscommon /sortdata/n,a(n)return (a(i).lt.a(j))

subroutine swap(i,j)common /sortdata/n,a(n)b = a(i)a(i) = a(j)a(j) = b

subroutine sort(n, less, swap)logical lessdo i = n, 2, -1 do j = 1, i-1 if (less(j,j+1)) then call swap(j,j+1) endif enddoenddo

44

Page 43: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

class sort_array {public: virtual bool less(int i, int j); virtual void swap(int i, int j);};

class sort_a : public sort_array {public: bool less(int i, int j) { return a(i) < a(j); } void swap(int i, int j) { ... } double a[];};

void sort(int n, sort_array& a) { for (int i = n-1, i > 0; --i) for (int j = 0; j < i; ++j) if (a.less(j,j+1)) a.swap(j,j+1);}

• less swap

•less swap

• sort

45

Page 44: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

• + = ( )+

• [Fortran] common

• [C++] sort_array

• [ ]

46

Page 45: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

Template

template<class A>void sort(int n, A& a) { for (int i = n-1, i > 0; --i) for (int j = 0; j < i; ++j) if (a.less(j,j+1)) a.swap(j,j+1);}

class myarray {public: bool less(int i, int j) { return a(i) < a(j); } void swap(int i, int j) { ... } double a[];};

myarray a;//…sort(n, a);

• sort

• less swapsort

47

Page 46: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

• +

• ( )

• ( )

• ( )

vs

48

Page 47: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

• class (int) (bool)

Template Metaprograming

template<int I, bool b> class myclass { /* ... */ };

template<class T> myclass { /* ... */ };template<> myclass<double> { /* ... */ };

49

Page 48: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

Static Factorial (N!)

// N template<int N> class Factorial {public: enum { value = N * Factorial<N-1>::value };};

// N=1 template<> class Factorial<1> {public: enum { value = 1; }};

Factorial<5>::value; // 120

50

Page 49: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

• • ( ) • Perl Python Ruby

• Mac OS X Linux • Windows & •

• •

• ( ) • CSV/XML/HDF5 DB CGI

GUI •

51

Page 50: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

ALPS Python

• Boost.Python

• C++ Python

• Python (pyalps)

• Python

52

Page 51: CMSI計算科学技術特論C (2015) ALPS と量子多体問題①

pyalps matplotlib

import pyalpsimport pyalps.plot as alpsplotimport matplotlib.pyplot as pyplot

data = pyalps.loadMeasurements(pyalps.getResultFiles(prefix='parm9a'), 'Magnetization Density^2’)for item in pyalps.flatten(data): item.props['L'] = int(item.props['L'])

magnetization2 = pyalps.collectXY(data, x='T', y='Magnetization Density^2', foreach=['L'])magnetization2.sort(key=lambda item: item.props['L'])

pyplot.figure()alpsplot.plot(magnetization2)pyplot.xlabel('Temperture $T$')pyplot.ylabel('Magnetization Density Squared $m^2$')pyplot.legend(loc='best')

53