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
50ed5d34
Commit
50ed5d34
authored
11 months ago
by
patavirt
Browse files
Options
Downloads
Patches
Plain Diff
examples: improve cpr_sns example plot
parent
48d4e9e4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/cpr_sns.py
+38
-46
38 additions, 46 deletions
examples/cpr_sns.py
with
38 additions
and
46 deletions
examples/cpr_sns.py
+
38
−
46
View file @
50ed5d34
...
...
@@ -95,70 +95,60 @@ def Gamma_to_alpha(Gamma_DP, Gamma_ST):
return
alpha_soc
,
eta
def
do
(
W_xi
=
6
,
multin
=
True
):
def
do
(
W_xi
=
12
,
multin
=
True
):
T
=
0.1
Gamma_DP
=
10
Gamma_ST
=
1
h
=
-
10.0
phi
=
np
.
linspace
(
0
,
2
*
pi
,
37
)
xi
=
1
/
np
.
sqrt
(
2
*
pi
)
L
=
np
.
array
([
0.1
,
1.5
,
2
,
3
])
*
xi
L
=
np
.
array
([
0.1
,
1.5
,
2
,
2.25
,
2.5
,
2.75
,
3
])
*
xi
W
=
W_xi
*
xi
alpha
,
eta
=
Gamma_to_alpha
(
Gamma_DP
,
Gamma_ST
)
L0
=
np
.
array
([
0.1
,
1.5
,
2
,
3
])
*
xi
Lsel
=
np
.
array
([
np
.
isclose
(
z
,
L0
).
any
()
for
z
in
L
])
res
=
j
(
T
,
h
,
phi
[
None
,
:],
alpha_soc
=
alpha
,
eta
=
eta
,
L
=
L
[:,
None
],
W
=
W
,
n
=
10
,
mem
=
mem
)
alpha
,
eta
=
Gamma_to_alpha
(
Gamma_DP
,
Gamma_ST
)
if
multin
:
ns
=
(
20
,
10
,
25
)
mphi
=
phi
[::
2
]
res0
=
j
(
T
,
h
,
mphi
[
None
,
:],
alpha_soc
=
alpha
,
eta
=
eta
,
L
=
L
[:,
None
],
W
=
W
,
n
=
5
,
mem
=
mem
,
)
res1
=
j
(
T
,
h
,
mphi
[
None
,
:],
alpha_soc
=
alpha
,
eta
=
eta
,
L
=
L
[:,
None
],
W
=
W
,
n
=
20
,
mem
=
mem
,
else
:
ns
=
(
20
,)
ress
=
[]
Jxs
=
[]
for
n
in
ns
:
if
multin
and
n
>
ns
[
0
]:
p
=
mphi
else
:
p
=
phi
res
=
j
(
T
,
h
,
p
[
None
,
:],
alpha_soc
=
alpha
,
eta
=
eta
,
L
=
L
[:,
None
],
W
=
W
,
n
=
n
,
mem
=
mem
)
ress
.
append
(
res
)
Jx_mean
=
np
.
asarray
(
[
Res
(
*
x
).
Jx
[
1
:
-
1
].
sum
(
axis
=
1
).
mean
(
axis
=
0
)
for
x
in
res
.
flat
]
).
reshape
(
res
.
shape
)
if
multin
:
Jx0_mean
=
np
.
asarray
(
[
Res
(
*
x
).
Jx
[
1
:
-
1
].
sum
(
axis
=
1
).
mean
(
axis
=
0
)
for
x
in
res0
.
flat
]
).
reshape
(
res0
.
shape
)
Jx1_mean
=
np
.
asarray
(
[
Res
(
*
x
).
Jx
[
1
:
-
1
].
sum
(
axis
=
1
).
mean
(
axis
=
0
)
for
x
in
res1
.
flat
]
).
reshape
(
res1
.
shape
)
Jx
=
np
.
asarray
(
[
Res
(
*
x
).
Jx
[
1
:
-
1
].
sum
(
axis
=
1
).
mean
(
axis
=
0
)
for
x
in
res
.
flat
]
).
reshape
(
res
.
shape
)
Jxs
.
append
(
Jx
)
fig
,
axs
=
plt
.
subplots
(
1
,
2
,
layout
=
"
compressed
"
)
ax
=
axs
[
0
]
ax
.
plot
(
phi
/
pi
,
Jx
_mean
.
T
/
abs
(
Jx
_mean
).
max
(
axis
=
1
))
ax
.
plot
(
phi
/
pi
,
Jx
s
[
0
][
Lsel
,
:]
.
T
/
abs
(
Jx
s
[
0
][
Lsel
]
).
max
(
axis
=
1
))
if
multin
:
# ax.plot(mphi / pi, Jx0_mean.T / abs(Jx0_mean).max(axis=1), "k:", alpha=0.25)
ax
.
plot
(
mphi
/
pi
,
Jx1_mean
.
T
/
abs
(
Jx1_mean
).
max
(
axis
=
1
),
"
k:
"
)
ax
.
plot
(
mphi
/
pi
,
Jxs
[
1
][
Lsel
,
:].
T
/
abs
(
Jxs
[
1
][
Lsel
]).
max
(
axis
=
1
),
"
k:
"
,
alpha
=
0.25
,
)
ax
.
plot
(
mphi
/
pi
,
Jxs
[
2
][
Lsel
,
:].
T
/
abs
(
Jxs
[
2
][
Lsel
]).
max
(
axis
=
1
),
"
k:
"
)
ax
.
set_xlabel
(
r
"
$\varphi / \pi$
"
)
ax
.
set_ylabel
(
r
"
$I / I_{\mathrm{max}}$
"
)
ax
.
legend
(
L
/
xi
,
title
=
r
"
$L/\xi$
"
,
loc
=
"
lower right
"
)
ax
.
legend
(
L
[
Lsel
]
/
xi
,
title
=
r
"
$L/\xi$
"
,
loc
=
"
lower right
"
)
def
eff
(
Jx
):
Jm
=
Jx
.
min
(
axis
=
1
)
...
...
@@ -166,12 +156,14 @@ def do(W_xi=6, multin=True):
return
(
abs
(
Jp
)
-
abs
(
Jm
))
/
(
abs
(
Jp
)
+
abs
(
Jm
))
ax
=
axs
[
1
]
ax
.
plot
(
L
/
xi
,
100
*
eff
(
Jx
_mean
))
ax
.
plot
(
L
/
xi
,
100
*
eff
(
Jx
s
[
0
]
))
if
multin
:
#
ax.plot(L / xi, 100 * eff(Jx
0_mean
), "k:", alpha=0.25)
ax
.
plot
(
L
/
xi
,
100
*
eff
(
Jx
1_mean
),
"
k:
"
)
ax
.
plot
(
L
/
xi
,
100
*
eff
(
Jx
s
[
1
]
),
"
k:
"
,
alpha
=
0.25
)
ax
.
plot
(
L
/
xi
,
100
*
eff
(
Jx
s
[
2
]
),
"
k:
"
)
ax
.
set_xlabel
(
r
"
$L / \xi$
"
)
ax
.
set_ylabel
(
r
"
$\eta$ [%]
"
)
if
multin
:
ax
.
legend
(
ns
)
fig
.
suptitle
(
rf
"
$h =
{
h
}
\Delta_0$, $T =
{
T
}
\Delta_0$, $W =
{
W
/
xi
}
\xi_0$ $\Gamma_{{DP}} =
{
Gamma_DP
}
\Delta_0$, $\Gamma_{{ST}} =
{
Gamma_ST
}
\Delta_0$ ($\tilde{{\eta}} =
{
eta
:
.
3
g
}
$, $\tilde{{\alpha}} =
{
alpha
:
.
3
g
}
$)
"
...
...
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