Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python-diagrams
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Valentin Bruch
python-diagrams
Commits
342a47c6
Commit
342a47c6
authored
Feb 10, 2020
by
Valentin Bruch
Browse files
Options
Downloads
Patches
Plain Diff
slightly restructured Keldysh contour ordering
parent
0d149b84
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
diagrams.py
+17
-3
17 additions, 3 deletions
diagrams.py
with
17 additions
and
3 deletions
diagrams.py
+
17
−
3
View file @
342a47c6
...
@@ -401,6 +401,7 @@ class Diagram:
...
@@ -401,6 +401,7 @@ class Diagram:
# Clear old data:
# Clear old data:
if
clear
:
if
clear
:
self
.
clear
()
self
.
clear
()
self
.
isKeldysh
=
False
# Remove ignored characters
# Remove ignored characters
for
c
in
ignore
:
for
c
in
ignore
:
...
@@ -476,6 +477,22 @@ class Diagram:
...
@@ -476,6 +477,22 @@ class Diagram:
if
vertex_indices
:
if
vertex_indices
:
print
(
'
Warning: diagram contains uncontracted indices:
'
,
*
vertex_indices
.
keys
(),
file
=
sys
.
stderr
)
print
(
'
Warning: diagram contains uncontracted indices:
'
,
*
vertex_indices
.
keys
(),
file
=
sys
.
stderr
)
# Tell contours about their order in Keldysh diagram.
if
self
.
isKeldysh
:
self
.
updateKeldyshOrder
()
def
updateKeldyshOrder
(
self
):
'
Tell contours about their order in Keldysh diagram.
'
keldysh_order
=
0
for
i
,
contour
in
enumerate
(
self
.
contours
,
1
):
# First draw the contour.
contour
.
keldysh_order
=
keldysh_order
try
:
if
self
.
interruptions
[
i
].
isKeldysh
():
keldysh_order
+=
1
except
IndexError
:
break
def
pprint
(
self
):
def
pprint
(
self
):
'''
'''
Produce more or less human readable output (without contractions!) for debugging.
Produce more or less human readable output (without contractions!) for debugging.
...
@@ -528,10 +545,8 @@ class Diagram:
...
@@ -528,10 +545,8 @@ class Diagram:
# Iterate over contours, interruptions and elements to draw vertices and interruptions.
# Iterate over contours, interruptions and elements to draw vertices and interruptions.
last_node
=
self
.
interruptions
[
0
]
last_node
=
self
.
interruptions
[
0
]
keldysh_order
=
-
1
+
self
.
isKeldysh
for
i
,
contour
in
enumerate
(
self
.
contours
,
1
):
for
i
,
contour
in
enumerate
(
self
.
contours
,
1
):
# First draw the contour.
# First draw the contour.
contour
.
keldysh_order
=
keldysh_order
for
j
,
e
in
enumerate
(
contour
.
elements
):
for
j
,
e
in
enumerate
(
contour
.
elements
):
if
type
(
e
)
!=
BaseLine
:
if
type
(
e
)
!=
BaseLine
:
factor
=
getattr
(
contour
.
elements
[
j
-
1
],
'
factor
'
,
1
)
or
1
factor
=
getattr
(
contour
.
elements
[
j
-
1
],
'
factor
'
,
1
)
or
1
...
@@ -545,7 +560,6 @@ class Diagram:
...
@@ -545,7 +560,6 @@ class Diagram:
else
:
else
:
assert
type
(
last_node
)
==
Interrupt
assert
type
(
last_node
)
==
Interrupt
last_node
=
self
.
interruptions
[
i
]
last_node
=
self
.
interruptions
[
i
]
keldysh_order
+=
1
elif
self
.
interruptions
[
i
].
label
:
elif
self
.
interruptions
[
i
].
label
:
factor
=
getattr
(
contour
.
elements
[
-
1
],
'
factor
'
,
1
)
or
1
factor
=
getattr
(
contour
.
elements
[
-
1
],
'
factor
'
,
1
)
or
1
print
(
self
.
interruptions
[
i
].
tikz
(
position
=
'
right of=%s, xshift=%g%s
'
%
(
last_node
.
right
(),
factor
*
self
.
sep
,
self
.
sep_unit
)),
file
=
file
)
print
(
self
.
interruptions
[
i
].
tikz
(
position
=
'
right of=%s, xshift=%g%s
'
%
(
last_node
.
right
(),
factor
*
self
.
sep
,
self
.
sep_unit
)),
file
=
file
)
...
...
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