Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
H
handyG
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
McMule
handyG
Commits
74156e8d
Commit
74156e8d
authored
Apr 02, 2019
by
Luca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parents
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
97 additions
and
0 deletions
+97
-0
.gitignore
.gitignore
+8
-0
makefile
makefile
+2
-0
utils.f90
utils.f90
+87
-0
No files found.
.gitignore
0 → 100644
View file @
74156e8d
*
!/**/
!*.*
!makefile
*.out
*.mod
*.smod
\ No newline at end of file
makefile
0 → 100644
View file @
74156e8d
sup
\ No newline at end of file
utils.f90
0 → 100644
View file @
74156e8d
! Contains some functions that might be useful later
MODULE
utils
implicit
none
CONTAINS
FUNCTION
dilog
(
x
,
n
)
! Computes the dilog Li_2(x) using the series representation up to order n
integer
::
n
complex
::
x
,
dilog
integer
::
i
integer
::
j
(
n
)
j
=
(/(
i
,
i
=
1
,
n
,
1
)/)
dilog
=
sum
(
x
**
j
/
j
**
2
)
END
FUNCTION
dilog
FUNCTION
polylog
(
m
,
x
,
n
)
! Computes the classical polylogarithm Li_m(x) using series representation up to order n
integer
::
m
,
n
complex
::
x
,
polylog
integer
::
i
integer
::
j
(
n
)
j
=
(/(
i
,
i
=
1
,
n
,
1
)/)
polylog
=
sum
(
x
**
j
/
j
**
m
)
END
FUNCTION
polylog
recursive
FUNCTION
multiple_polylog
(
m
,
x
,
n
)
result
(
res
)
! Computes the multiple polylogarithm Li_{m1,...,mk} (x1,...,xk) up to order n
integer
::
m
(:)
complex
::
x
(:)
complex
::
res
integer
::
n
,
i
! print*, 'm = ', m
! print*, 'x = ', x
! print*, 'n = ', n
if
(
size
(
m
)
/
=
size
(
x
))
then
print
*
,
'Error: m and x must have the same length'
end
if
if
(
size
(
m
)
==
1
)
then
! base case
! print*, 'landed in base case'
res
=
polylog
(
m
(
1
),
x
(
1
),
n
)
else
! recursion step
! print*, 'landed in step'
res
=
0
do
i
=
1
,
n
res
=
res
+
x
(
1
)
**
i
/
i
**
m
(
1
)
*
multiple_polylog
(
m
(
2
:),
x
(
2
:),
i
-
1
)
end
do
! a nicer way to do it would be but problem is i
! i = (/(j, j=1,n, 1)/)
! res = sum( x(1)**i / i**m(1) * multiple_polylog(m(2:), x(2:), i(1) - 1) )
end
if
END
FUNCTION
multiple_polylog
END
MODULE
utils
PROGRAM
test
! Used to test the procedures defined in this module
use
utils
implicit
none
complex
::
result
! print*, dilog((0.8,0),100) ! should be 1.07479 + 0i
! print*, dilog((0.2,0.5),100) ! should be 0.133909 + 0.537628i
! print*, polylog(2,(0.2,0.5),100) ! should be 0.133909 + 0.537628i
! print*, polylog(5,(0.2,0.5),100) ! should be 0.192872345 + 0.505898833i
result
=
multiple_polylog
((/
5
/),(/
(
0.2
,
0.5
)
/),
100
)
print
*
,
'result = '
,
result
result
=
multiple_polylog
((/
5
,
5
/),(/
(
0.8
,
0
),(
0.3
,
0.5
)
/),
100
)
print
*
,
'result = '
,
result
END
PROGRAM
test
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