Skip to content

Commit

Permalink
sample data for a correlation matrix added, gevp manual updated, exam…
Browse files Browse the repository at this point in the history
…ple added
  • Loading branch information
urbach committed Jul 12, 2018
1 parent 6e9588f commit 2853f8d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
8 changes: 5 additions & 3 deletions R/gevp.R
Expand Up @@ -72,10 +72,12 @@ gevp <- function(cf, Time, t0 = 1, element.order = 1:cf$nrObs,

## now the time dependence for t != t0
## we need to multiply from the left with t(invL) and from the right with invL
for(t in c((t0 + 1):(Thalf), 0:(t0-1))) {
for(t in c((t0 + 1):(Thalf), (t0-1):0)) {
t.sort <- t0+2
## if wanted sort by the previous t, i.e. t.sort <- t + 1 - 1
if((t != t0+1) && !sort.t0) t.sort <- t
## if wanted sort by the previous t, i.e. t.sort <- t + 1 - 1 for t > t0
if((t > t0+1) && !sort.t0) t.sort <- t
## and t.sort <- t + 1 + 1 for t < t0
if((t < t0-1) && !sort.t0) t.sort <- t + 2
## matrix at t and symmetrise
cM <- 0.5*matrix(Cor[ii+t], nrow=matrix.size, ncol=matrix.size)
cM <- cM + t(cM)
Expand Down
Binary file added data/correlatormatrix.RData
Binary file not shown.
1 change: 1 addition & 0 deletions data/datalist
@@ -1,3 +1,4 @@
plaq.sample
pscor.sample
samplecf
correlatormatrix
29 changes: 20 additions & 9 deletions man/bootstrap.gevp.Rd
Expand Up @@ -39,12 +39,17 @@ element.order=c(1,2,3,4), seed=1234, sort.type="vectors", sort.t0=TRUE)
\item{sort.type}{
Sort the eigenvalues either in descending order, or by using the
scalar product of the eigenvectors with the eigenvectors at
\eqn{t=t_0+1}{t=t0+1}. Possible values are "values" or "vectors".
\eqn{t=t_0+1}{t=t0+1}. Possible values are "values", "vectors" and
"det". The last one represents a time consuming, but in principle
better version of sorting by vectors.
}
\item{sort.t0}{
for \code{sort.type} "vectors" use \eqn{t_0}{t0} as reference or \eqn{t-1}{t-1}.
}
}
\details{
Say something on "det" sorting method.
}
\value{
Returns an object of class \code{gevp} with member objects:

Expand All @@ -70,14 +75,20 @@ element.order=c(1,2,3,4), seed=1234, sort.type="vectors", sort.t0=TRUE)
\code{gevp}, \code{extract.obs}, \code{bootstrap.cf}
}
\examples{
\dontrun{pion.cor.gevp <- bootstrap.gevp(pion.cor, t0=1)}
\dontrun{## extract the first principal correlator}
\dontrun{pion.pc1 <- gevp2cf(pion.cor.gevp, id=1)}
\dontrun{## which can now be treated like a bootstrapped correlation function}
\dontrun{pion.pc1.effectivemass <- bootstrap.effectivemass(cf=pion.pc1, type="acosh")}
\dontrun{pion.pc1.effectivemass <- fit.effectivemass(pion.pc1.effectivemass, t1=12, t2=23, useCov=FALSE)}
\dontrun{summary(pion.pc1.effectivemass)}
\dontrun{plot(pion.pc1.effectivemass, xlab=c("t/a"), ylab=c("aM"))}
data(correlatormatrix)
## bootstrap the correlator matrix
correlatormatrix <- bootstrap.cf(correlatormatrix, boot.R=400, boot.l=1, seed=132435)
## solve the GEVP
correlatormatrix.gevp <- bootstrap.gevp(cf=correlatormatrix, t0=4, element.order=c(1,2,3,4))
## extract the ground state and plot
pc1 <- gevp2cf(gevp=correlatormatrix.gevp, id=1)
plot(pc1, log="y")
## determine the corresponding effective masses
pc1.effectivemass <- bootstrap.effectivemass(cf=pc1)
pc1.effectivemass <- fit.effectivemass(cf=pc1.effectivemass, t1=5, t2=20)
## summary and plot
summary(pc1.effectivemass)
plot(pc1.effectivemass)
}
\author{Carsten Urbach, \email{curbach@gmx.de}}
\keyword{GEVP}
Expand Down

0 comments on commit 2853f8d

Please sign in to comment.