Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
usadelndsoc
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JYU Condensed Matter Theory
usadelndsoc
Commits
ecbca958
Commit
ecbca958
authored
2 years ago
by
patavirt
Browse files
Options
Downloads
Patches
Plain Diff
edit
parent
41a19b3a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/core.cpp
+2
-4
2 additions, 4 deletions
src/core.cpp
src/xtest.f95
+21
-5
21 additions, 5 deletions
src/xtest.f95
with
23 additions
and
9 deletions
src/core.cpp
+
2
−
4
View file @
ecbca958
...
...
@@ -132,9 +132,7 @@ public:
compute
(
Q
);
auto
jac
=
f_
.
Jacobian
(
x
);
std
::
array
<
size_t
,
1
>
shape
=
{
jac
.
size
()
/
2
};
return
Array
<
Complex
,
Shape
<
Dynamic
>
,
Vector
<
double
>
>
(
std
::
move
(
jac
),
shape
);
return
Array
<
double
,
Shape
<
Dynamic
>
,
Vector
<
double
>
>
(
std
::
move
(
jac
),
{
jac
.
size
()});
}
auto
hess
(
const
QType
&
Q
)
...
...
@@ -184,7 +182,7 @@ public:
Array
<
double
,
Shape
<
Dynamic
>
>
jac
({
n
});
stack
.
jacobian
(
jac
.
data
());
return
std
::
move
(
jac
)
;
return
jac
;
}
};
...
...
This diff is collapsed.
Click to expand it.
src/xtest.f95
+
21
−
5
View file @
ecbca958
...
...
@@ -2,11 +2,11 @@ program main
use
adjac
implicit
none
type
(
adjac_complexan
),
dimension
(
5
,
5
,
2
,
2
,
2
)
::
Q
double
complex
,
dimension
(
5
,
5
,
4
,
4
,
4
)
::
U
type
(
adjac_complexan
),
dimension
(
5
0
,
5
0
,
2
,
2
,
2
)
::
Q
double
complex
,
dimension
(
5
0
,
5
0
,
4
,
4
,
4
)
::
U
type
(
adjac_complexan
),
dimension
(
1
)
::
res
double
complex
,
dimension
(
1
,
5
*
5
*
2
*
2
*
2
)
::
jac
double
complex
,
dimension
(
1
,
5
0
*
5
0
*
2
*
2
*
2
)
::
jac
double
complex
::
v
integer
i1
,
i2
,
i3
,
i4
,
i5
,
p
,
p2
...
...
@@ -118,6 +118,9 @@ contains
integer
,
dimension
(
2
),
parameter
::
Nj
=
(/
1
,
0
/)
integer
,
dimension
(
4
),
parameter
::
invk
=
(/
4
,
3
,
2
,
1
/)
type
(
adjac_complexan
),
dimension
(:,:,:,:),
allocatable
::
Qmat
logical
,
dimension
(:,:),
allocatable
::
initQ
type
(
adjac_complexan
),
dimension
(
4
,
4
)
::
M
,
Q1
,
Q2
integer
::
i
,
j
,
k
,
i2
,
j2
,
nx
,
ny
...
...
@@ -133,11 +136,18 @@ contains
stop
end
if
allocate
(
Qmat
(
nx
,
ny
,
4
,
4
))
allocate
(
initQ
(
ny
,
nx
))
initQ
=
.false.
res
=
0
do
i
=
1
,
nx
do
j
=
1
,
ny
Q1
=
get_Q_matrix
(
Q
(
i
,
j
,:,:,:))
if
(
.not.
initQ
(
i
,
j
))
then
Qmat
(
i
,
j
,:,:)
=
get_Q_matrix
(
Q
(
i
,
j
,:,:,:))
initQ
(
i
,
j
)
=
.true.
end
if
do
k
=
1
,
2
i2
=
i
+
Ni
(
k
)
...
...
@@ -146,7 +156,13 @@ contains
if
(
i2
<
1
.or.
i2
>
nx
)
cycle
if
(
j2
<
1
.or.
j2
>
ny
)
cycle
Q2
=
get_Q_matrix
(
Q
(
i2
,
j2
,:,:,:))
if
(
.not.
initQ
(
i2
,
j2
))
then
Qmat
(
i2
,
j2
,:,:)
=
get_Q_matrix
(
Q
(
i2
,
j2
,:,:,:))
initQ
(
i2
,
j2
)
=
.true.
end
if
Q1
=
Qmat
(
i
,
j
,:,:)
Q2
=
Qmat
(
i2
,
j2
,:,:)
M
=
Q1
-
matmul
(
U
(
i
,
j
,
k
,:,:),
matmul
(
Q2
,
U
(
i2
,
j2
,
invk
(
k
),:,:)))
res
=
res
+
2
/(
4
*
h
)
*
trace
(
matmul
(
M
,
M
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment