-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathE2_0.Rmd
231 lines (163 loc) · 5.09 KB
/
E2_0.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
---
title: "Cross check E2 with hadron"
author: "Marco Garofalo"
date: "2/9/2021"
output: html_document
---
```{r setup, include=FALSE}
```
## Opening the file and loading libraries
```{r }
library(hadron)
if(!exists("foo", mode="function")) source("read_header.R")
to.read = file("/home/marco/analysis/phi4/tuning_masses/G2t_T128_L20_msq0-4.925000_msq1-4.850000_l02.500000_l12.500000_mu5.000000_g0.000000_rep0_merged_bin10000", "rb")
```
## Read the header
```{r}
header<-read_header(to.read)
header
```
## Reading the configuration
We read the configuration from the file in to the three dimensional array d
```{r}
configurations <- list()
d<-array(dim = c(header$ncorr, header$L[1], header$confs) )
for (iconf in c(1:header$confs)){
configurations<-append(configurations, readBin(to.read, integer(),n = 1, endian = "little"))
for(t in c(1:header$L[1] ) ){
for (corr in c(1:header$ncorr)){
d[corr, t, iconf]<-readBin(to.read, double(),n = 1, endian = "little")
}
}
}
```
## construct the cf container
here we select the correlator n=1
$$\langle \phi_0(t) \phi_0(0)\rangle$$
```{r}
n<-1
mycf <- cf_meta(nrObs =1, Time = header$L[1], nrStypes = 1)
mycf <- cf_orig(mycf, cf = t(d[n, ,]))
mycf <- symmetrise.cf(mycf, sym.vec = c(1))
# Bootstrap cf
boot.R <- 150
boot.l <- 1
seed <- 1433567
cfb <- bootstrap.cf(cf=mycf, boot.R=boot.R, boot.l=boot.l, seed=seed)
```
## Single particle energy
here we are plotting the "log" effective mass $\log c(t)/c(t+1)$
```{r, warning=FALSE}
log_meff <-bootstrap.effectivemass(cfb, type='log')
plot(log_meff)
```
## Two particel energy
Here we select the correlator n=3
$$
\langle\phi_0(t)^2 \phi_0(0)^2 \rangle
$$
```{r}
n<-3
mycf <- cf_meta(nrObs =1, Time = header$L[1], nrStypes = 1)
mycf <- cf_orig(mycf, cf = t(d[n, ,]))
mycf <- symmetrise.cf(mycf, sym.vec = c(1))
# Bootstrap cf
boot.R <- 150
boot.l <- 1
seed <- 1433567
cfb <- bootstrap.cf(cf=mycf, boot.R=boot.R, boot.l=boot.l, seed=seed)
```
The plot of the effective mass is not what we expected, ignoring finite T pollution this should be a constant as in the case of one particle.
```{r}
log_meff <-bootstrap.effectivemass(cfb, type='log')
plot(log_meff)
```
The shifted effective mass instead looks fine
```{r}
scf<-removeTemporal.cf(cfb)
shifted_log_meff <-bootstrap.effectivemass(scf, type='shifted')
plot(shifted_log_meff)
```
# Two different particle energy
Here we select the correlator n=12
$$
\langle\phi_0(t)\phi_1(t) \phi_0(0)\phi_1(0) \rangle
$$
```{r, warning=FALSE}
n<-12
mycf <- cf_meta(nrObs =1, Time = header$L[1], nrStypes = 1)
mycf <- cf_orig(mycf, cf = t(d[n, ,]))
mycf <- symmetrise.cf(mycf, sym.vec = c(1))
# Bootstrap cf
boot.R <- 150
boot.l <- 1
seed <- 1433567
cfb <- bootstrap.cf(cf=mycf, boot.R=boot.R, boot.l=boot.l, seed=seed)
log_meff <-bootstrap.effectivemass(cfb, type='log')
plot(log_meff)
```
# GEVP
```{r}
n_00<-3
n_11<-4
n_01<-13
mycf<- cf()
for (n in c(n_00,n_01,n_01,n_11)){
cf_tmp <- cf_meta(nrObs =1, Time = header$L[1], nrStypes = 1)
cf_tmp <- cf_orig(cf_tmp, cf = t(d[n, ,]))
cf_tmp <- symmetrise.cf(cf_tmp, sym.vec = c(1))
mycf<- c(mycf, cf_tmp)
}
# Bootstrap cf
boot.R <- 150
boot.l <- 1
seed <- 1433567
cfb <- bootstrap.cf(cf=mycf, boot.R=boot.R, boot.l=boot.l, seed=seed)
scf<-removeTemporal.cf(cfb)
plot(scf, log="y",xlab=c("t/a"), ylab="C(t)")
t0 <- 3
correlatormatrix.gevp <- bootstrap.gevp(cf=scf, t0=t0, element.order=c(1,2,3,4), sort.type="values")
pc1 <- gevp2cf(gevp=correlatormatrix.gevp, id=1)
pc2 <- gevp2cf(gevp=correlatormatrix.gevp, id=2)
plot(pc1, col="red", pch=21, log="y", xlab="t", ylab="C(t)")
plot(pc2, rep=TRUE, col="blue", pch=22)
pc1.matrixfit <- matrixfit(cf=pc1, t1=4, t2=10, useCov=TRUE,parlist=array(c(1,1), dim=c(2,1)),sym.vec=c("cosh"), fit.method="lm", model="shifted")
#plot(pc1.matrixfit, do.qqplot=FALSE,xlab="t", ylab="C(t)")
library(plotly)
plot(pc1.matrixfit, do.qqplot=FALSE,xlab="t", ylab="C(t)", plot.raw=FALSE)
abline(h=1, lty=2)
summary(pc1.matrixfit)
```
## Compare hadron marco
```{r}
dfh<- data.frame("t"=pc1.matrixfit$CF$t , "corr"=pc1.matrixfit$M, "err"=pc1.matrixfit$CF$Err)
gg<-ggplot()
gg<-gg +geom_point(data=dfh, mapping=aes(x=t, y=corr))
plot(gg)
```
# T48
```{r}
to.read = file("/home/marco/analysis/phi4/tuning_masses/G2t_T48_L20_msq0-4.925000_msq1-4.850000_l02.500000_l12.500000_mu5.000000_g0.000000_rep1_bin10000", "rb")
header<-read_header(to.read)
configurations <- list()
d<-array(dim = c(header$ncorr, header$L[1], header$confs) )
for (iconf in c(1:header$confs)){
configurations<-append(configurations, readBin(to.read, integer(),n = 1, endian = "little"))
for(t in c(1:header$L[1] ) ){
for (corr in c(1:header$ncorr)){
d[corr, t, iconf]<-readBin(to.read, double(),n = 1, endian = "little")
}
}
}
n<-3
mycf <- cf_meta(nrObs =1, Time = header$L[1], nrStypes = 1)
mycf <- cf_orig(mycf, cf = t(d[n, ,]))
mycf <- symmetrise.cf(mycf, sym.vec = c(1))
# Bootstrap cf
boot.R <- 150
boot.l <- 1
seed <- 1433567
cfb <- bootstrap.cf(cf=mycf, boot.R=boot.R, boot.l=boot.l, seed=seed)
log_meff <-bootstrap.effectivemass(cfb, type='log')
plot(log_meff)
```