Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
juobs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Javier Ugarrio
juobs
Commits
f3b82863
Commit
f3b82863
authored
Nov 26, 2020
by
Alessandro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
introducing new routines for gevp
parent
1ad65f09
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
17 deletions
+58
-17
src/juobs.jl
src/juobs.jl
+1
-1
src/juobs_linalg.jl
src/juobs_linalg.jl
+57
-16
No files found.
src/juobs.jl
View file @
f3b82863
...
...
@@ -8,7 +8,7 @@ include("juobs_tools.jl")
include
(
"juobs_obs.jl"
)
export
read_mesons
,
read_ms1
,
read_ms
,
read_md
export
get_matrix
,
uwgevp_tot
,
energies
,
uwdot
export
get_matrix
,
uwgevp_tot
,
energies
,
uwdot
,
uweigvals
,
uweigvecs
,
uweigen
,
invert
export
corr_obs
,
plat_av
,
lin_fit
,
x_lin_fit
,
y_lin_fit
,
fit_routine
export
meff
,
dec_const_pcvc
,
comp_t0
...
...
src/juobs_linalg.jl
View file @
f3b82863
...
...
@@ -11,6 +11,19 @@
#
#
##################################################################
using
ForwardDiff
,
LinearAlgebra
for
op
in
(
:
eigvals
,
:
eigvecs
)
@eval
function
LinearAlgebra
.$
op
(
a
::
Matrix
{
uwreal
})
function
fvec
(
x
::
Matrix
)
return
LinearAlgebra
.$
op
(
x
)
end
return
fvec
(
value
.
(
a
))
#return uwreal(LinearAlgebra.$op(a.mean), a.prop, ForwardDiff.derivative($op, a.mean)*a.der)
end
end
##
@doc
raw
"""
get_matrix(corr_diag::Vector{Array}, corr_upper::Vector{Array} )
...
...
@@ -172,23 +185,51 @@ Return the eigenvalues of the uwreal matrix a.
If evec = true also the eigenvectors are returned as columns of the orthogonal matrix u.
The keyword iter, set by default to 30, selects the number of iterations of the qr algorithm before stopping.
"""
function
uwe
vp
(
a
::
Matrix
{
uwreal
};
iter
=
30
,
evec
=
false
)
function
uwe
igvals
(
a
::
Matrix
{
uwreal
};
iter
=
30
)
n
=
size
(
a
,
1
)
if
evec
u
=
idty
(
n
)
for
k
in
1
:
iter
q_k
,
r_k
=
qr
(
a
)
a
=
uwdot
(
r_k
,
q_k
)
u
=
uwdot
(
u
,
q_k
)
end
return
a
,
u
else
for
k
in
1
:
iter
q_k
,
r_k
=
qr
(
a
)
a
=
uwdot
(
r_k
,
q_k
)
end
return
a
for
k
in
1
:
iter
q_k
,
r_k
=
qr
(
a
)
a
=
uwdot
(
r_k
,
q_k
)
end
return
a
#get_diag(a)
end
function
uweigvals
(
a
::
Matrix
{
uwreal
},
b
::
Matrix
{
uwreal
};
iter
=
30
)
c
=
uwdot
(
invert
(
b
),
a
)
n
=
size
(
c
,
1
)
for
k
in
1
:
iter
q_k
,
r_k
=
qr
(
c
)
c
=
uwdot
(
r_k
,
q_k
)
end
return
c
#get_diag(c)
end
function
uweigvecs
(
a
::
Matrix
{
uwreal
};
iter
=
30
)
n
=
size
(
a
,
1
)
u
=
idty
(
n
)
for
k
in
1
:
iter
q_k
,
r_k
=
qr
(
a
)
a
=
uwdot
(
r_k
,
q_k
)
u
=
uwdot
(
u
,
q_k
)
end
return
u
end
function
uweigvecs
(
a
::
Matrix
{
uwreal
},
b
::
Matrix
{
uwreal
};
iter
=
30
)
c
=
uwdot
(
invert
(
b
),
a
)
n
=
size
(
c
,
1
)
u
=
idty
(
n
)
for
k
in
1
:
iter
q_k
,
r_k
=
qr
(
c
)
c
=
uwdot
(
r_k
,
q_k
)
u
=
uwdot
(
u
,
q_k
)
end
return
u
end
function
uweigen
(
a
::
Matrix
{
uwreal
};
iter
=
30
)
return
uweigvals
(
a
,
iter
=
iter
),
uweigvecs
(
a
,
iter
=
iter
)
end
function
uweigen
(
a
::
Matrix
{
uwreal
},
b
::
Matrix
{
uwreal
};
iter
=
30
)
return
uweigvals
(
a
,
b
,
iter
=
iter
),
uweigvecs
(
a
,
b
,
iter
=
iter
)
end
function
norm_evec
(
evec
::
Matrix
{
uwreal
},
ctnot
::
Matrix
{
uwreal
})
...
...
@@ -414,7 +455,7 @@ It returns the norm of a vector of uwreal
function
uwnorm
(
a
::
Vector
{
uwreal
})
norm
=
sqrt
(
uwdot
(
a
,
a
))
uwerr
(
norm
)
return
norm
return
norm
end
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment