Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cdc-counting
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Radek Hušek
cdc-counting
Commits
f8d714f2
Commit
f8d714f2
authored
3 years ago
by
Radek Hušek
Browse files
Options
Downloads
Patches
Plain Diff
Extend UnderlyingGraph parameter to free edges
parent
7dc759bc
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
graph_tools/parameters.py
+15
-3
15 additions, 3 deletions
graph_tools/parameters.py
with
15 additions
and
3 deletions
graph_tools/parameters.py
+
15
−
3
View file @
f8d714f2
...
...
@@ -109,6 +109,10 @@ def _init_():
BV
((
0
,
0
,
0
),
Graph
([[
0
],
[]],
multiedges
=
True
,
loops
=
True
,
immutable
=
True
))
]
FREE_EDGE
=
[
BV
((
0
,
0
),
Graph
([[
0
],
[]],
multiedges
=
True
,
loops
=
True
,
immutable
=
True
))
]
def
join_boundaries
(
self
,
x
,
_
):
offsets
=
[
0
]
for
b
in
x
:
...
...
@@ -137,17 +141,25 @@ def _init_():
def
merge_values
(
self
,
a
,
b
):
assert
False
def
finalize
(
self
,
b
):
from
sage.all
import
Graph
assert
len
(
b
)
==
1
assert
b
[
0
].
boundary
==
tuple
()
return
b
[
0
].
value
G
=
Graph
(
b
[
0
].
value
,
immutable
=
False
)
for
v
in
G
.
vertices
():
if
G
.
degree
(
v
)
!=
2
:
continue
u
,
w
=
G
.
neighbors
(
v
)
G
.
add_edge
(
u
,
w
)
G
.
delete_vertex
(
v
)
return
Graph
(
G
,
immutable
=
True
)
@Singleton
class
VertexCount
(
GraphParameterBase
):
"""
Count vertices of gadget.
Same as `gadget.eval(UnderlyingGraph).num_verts()` but
also works for gadgets containing FREE_EDGE.
Same as `gadget.eval(UnderlyingGraph).num_verts()`.
"""
CUBIC_VERTEX
=
[
BV
(
None
,
1
)
]
FREE_EDGE
=
[
BV
(
None
,
0
)
]
...
...
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