Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frtrglib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Valentin Bruch
frtrglib
Commits
e1cdda50
Verified
Commit
e1cdda50
authored
Sep 5, 2022
by
Valentin Bruch
Browse files
Options
Downloads
Patches
Plain Diff
basic branch cut visualization
parent
1ef15f03
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
kondo.py
+2
-2
2 additions, 2 deletions
kondo.py
poles.py
+105
-0
105 additions, 0 deletions
poles.py
with
107 additions
and
2 deletions
kondo.py
+
2
−
2
View file @
e1cdda50
...
...
@@ -2036,7 +2036,7 @@ class Kondo:
self
.
odeFunctionIm
,
(
eiminit
,
eimfinal
),
init_values
,
t_eval
=
((
eimfinal
,)
if
only_final
else
None
),
t_eval
=
solveopts
.
pop
(
"
t_eval
"
,
((
eimfinal
,)
if
only_final
else
None
)
)
,
**
solveopts
)
return
output
...
...
@@ -2067,7 +2067,7 @@ class Kondo:
self
.
odeFunctionRe
,
(
reEinit
,
reEfinal
),
init_values
,
t_eval
=
((
eimfinal
,)
if
only_final
else
None
),
t_eval
=
solveopts
.
pop
(
"
t_eval
"
,
((
eimfinal
,)
if
only_final
else
None
)
)
,
**
solveopts
)
return
output
...
...
This diff is collapsed.
Click to expand it.
poles.py
0 → 100644
+
105
−
0
View file @
e1cdda50
#!/usr/bin/env python3
# Copyright 2022 Valentin Bruch <valentin.bruch@rwth-aachen.de>
# License: MIT
"""
Kondo FRTRG, analyze poles and branch cuts
"""
from
kondo
import
Kondo
import
numpy
as
np
import
matplotlib.pyplot
as
plt
from
settings
import
logger
from
matplotlib.colors
import
LogNorm
def
plot_bc
(
epsilon
=
1e-4
,
ir_cutoff
=
0.1
,
depth
=
20
,
solver_parameters
=
{},
nmax
=
10
,
voltage_branches
=
4
,
omega
=
16.5372
,
vdc
=
1
,
resolution
=
100
,
**
parameters
):
"""
Plot branch cuts for directly calculated data.
"""
t
=
np
.
linspace
(
ir_cutoff
,
-
depth
,
resolution
)
logger
.
info
(
"
Starting initial RG flow
"
)
kondo
=
Kondo
(
nmax
=
nmax
,
voltage_branches
=
voltage_branches
,
omega
=
omega
,
vdc
=
vdc
,
**
parameters
,
compact
=
0
)
solver
=
kondo
.
run
(
**
solver_parameters
,
ir_cutoff
=
ir_cutoff
)
# left of center
logger
.
info
(
"
Moving to left branch
"
)
solver_left
=
kondo
.
solveOdeRe
(
0.
,
-
epsilon
,
**
solver_parameters
,
init_values
=
solver
.
y
[:,
-
1
])
assert
np
.
allclose
(
kondo
.
energy
,
1j
*
ir_cutoff
-
epsilon
)
logger
.
info
(
"
Solving along left branch
"
)
solver_left_down
=
kondo
.
solveOdeIm
(
ir_cutoff
,
-
depth
,
**
solver_parameters
,
init_values
=
solver_left
.
y
[:,
-
1
],
t_eval
=
t
)
# right of center
kondo
.
global_properties
.
energy
=
1j
*
ir_cutoff
logger
.
info
(
"
Moving to right branch
"
)
solver_right
=
kondo
.
solveOdeRe
(
0.
,
epsilon
,
**
solver_parameters
,
init_values
=
solver
.
y
[:,
-
1
])
assert
np
.
allclose
(
kondo
.
energy
,
1j
*
ir_cutoff
+
epsilon
)
logger
.
info
(
"
Solving along right branch
"
)
solver_right_down
=
kondo
.
solveOdeIm
(
ir_cutoff
,
-
depth
,
**
solver_parameters
,
init_values
=
solver_right
.
y
[:,
-
1
],
t_eval
=
t
)
gamma_size
=
kondo
.
gamma
.
values
.
size
y_diff_abs
=
np
.
abs
(
solver_right_down
.
y
-
solver_left_down
.
y
)
gamma_diff_abs
=
y_diff_abs
[:
gamma_size
].
reshape
((
*
kondo
.
gamma
.
values
.
shape
,
resolution
))
logger
.
info
(
"
Preparing plot
"
)
fig
,
ax
=
plt
.
subplots
()
x_data
=
[]
y_data
=
[]
z_data
=
[]
for
vb
in
range
(
-
voltage_branches
,
voltage_branches
+
1
):
for
n
in
range
(
-
nmax
,
nmax
+
1
):
x_data
.
append
((
vb
*
vdc
+
omega
*
n
)
*
np
.
ones_like
(
t
))
y_data
.
append
(
t
)
z_data
.
append
(
gamma_diff_abs
[
vb
+
voltage_branches
,
n
+
nmax
,
n
+
nmax
])
x_data
=
np
.
concatenate
(
x_data
,
axis
=
None
)
y_data
=
np
.
concatenate
(
y_data
,
axis
=
None
)
z_data
=
np
.
concatenate
(
z_data
,
axis
=
None
)
plot
=
ax
.
scatter
(
x_data
,
y_data
,
c
=
z_data
,
norm
=
LogNorm
(
epsilon
,
3
),
cmap
=
plt
.
cm
.
viridis
)
fig
.
colorbar
(
plot
,
ax
=
ax
)
plt
.
show
()
if
__name__
==
"
__main__
"
:
plot_bc
(
epsilon
=
1e-6
,
solver_parameters
=
dict
(
rtol
=
1e-10
,
atol
=
1e-12
),
d
=
1e9
,
omega
=
16.5372
,
vdc
=
5
,
vac
=
7
,
nmax
=
12
,
voltage_branches
=
5
,
method
=
"
mu
"
)
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