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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Radek Hušek
cdc-counting
Commits
ec6b2602
Commit
ec6b2602
authored
5 years ago
by
Radek Hušek
Browse files
Options
Downloads
Patches
Plain Diff
Do not expect Boundary to have 2 elements
parent
b1058793
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
graph_tools/base.py
+3
-3
3 additions, 3 deletions
graph_tools/base.py
graph_tools/parameters.py
+2
-2
2 additions, 2 deletions
graph_tools/parameters.py
graph_tools/tests.py
+1
-1
1 addition, 1 deletion
graph_tools/tests.py
with
6 additions
and
6 deletions
graph_tools/base.py
+
3
−
3
View file @
ec6b2602
...
...
@@ -225,13 +225,13 @@ def _init_():
size
=
len
(
sorted_boundaries
)
m
=
matrix
(
QQ
,
size
,
size
,
{
(
rename
[
row
],
rename
[
col
]):
value
(
rename
[
b
.
boundary
],
rename
[
col
]):
b
.
value
for
col
in
sorted_boundaries
for
row
,
value
in
self
.
_next_gadget
(
FakeGadget
(
start_gadget
.
size
(),
[
Boundary
(
col
,
1
)
])).
eval_gadget
(
parameter
)
for
b
in
self
.
_next_gadget
(
FakeGadget
(
start_gadget
.
size
(),
[
Boundary
(
col
,
1
)
])).
eval_gadget
(
parameter
)
})
iv
=
matrix
(
QQ
,
size
,
1
,
{
(
rename
[
row
],
0
):
v
for
row
,
v
in
start_gadget
.
eval_gadget
(
parameter
)
(
rename
[
b
.
boundary
],
0
):
b
.
value
for
b
in
start_gadget
.
eval_gadget
(
parameter
)
})
fin
=
matrix
(
QQ
,
1
,
size
,
{
...
...
This diff is collapsed.
Click to expand it.
graph_tools/parameters.py
+
2
−
2
View file @
ec6b2602
...
...
@@ -234,8 +234,8 @@ def _init_():
>>>
def
test
(
*
args
):
return
list
(
CircuitDoubleCover
.
join_edges
(
*
args
))
>>>
test
(
B
(((
1
,
2
),
(
2
,
3
),
(
1
,
3
),
None
),
1
),
1
,
2
)
[]
>>>
test
(
B
(((
1
,
2
),
(
2
,
3
),
(
1
,
4
),
(
3
,
4
),
None
),
1
),
1
,
2
)
[
B
oundary
(
boundary
=
((
3
,
2
),
(
2
,
3
),
(
3
,
2
),
(
3
,
2
),
None
),
value
=
1
)]
>>>
assert
test
(
B
(((
1
,
2
),
(
2
,
3
),
(
1
,
4
),
(
3
,
4
),
None
),
1
),
1
,
2
)
==
\
[
B
(
((
3
,
2
),
(
2
,
3
),
(
3
,
2
),
(
3
,
2
),
None
),
1
)]
>>>
test
(
B
(((
1
,
2
),
(
2
,
3
),
(
1
,
4
),
(
3
,
4
),
None
,
(
1
,
3
)),
1
),
1
,
2
)
[]
>>>
len
(
test
(
B
(((
1
,
2
),
(
2
,
3
),
(
4
,
5
),
(
1
,
3
),
(
4
,
5
),
None
),
1
),
1
,
2
))
...
...
This diff is collapsed.
Click to expand it.
graph_tools/tests.py
+
1
−
1
View file @
ec6b2602
...
...
@@ -21,7 +21,7 @@ True
>>>
Necklace
.
stabilize
(
CircuitDoubleCover
)
Loop
1
done
-
1
boundaries
(
0
new
)
{
'
variables
'
:
[((
1
,
2
),
(
1
,
2
),
None
)],
'
step_matrix
'
:
[
4
],
'
initial_vector
'
:
[
2
],
'
finalize
'
:
[
1
]}
>>>
sun_cdc
=
lambda
n
:
sum
(
v
for
_
,
v
in
sun
(
n
).
eval_gadget
(
CircuitDoubleCover
)
)
>>>
sun_cdc
=
lambda
n
:
sum
(
b
.
value
for
b
in
sun
(
n
).
eval_gadget
(
CircuitDoubleCover
)
)
>>>
all
(
sun_cdc
(
n
)
==
2
**
n
-
2
*
n
for
n
in
range
(
3
,
10
)
)
True
...
...
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