-
Notifications
You must be signed in to change notification settings - Fork 3
Refactor 2.0 #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor 2.0 #116
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #116 +/- ##
==========================================
- Coverage 95.51% 94.32% -1.20%
==========================================
Files 34 33 -1
Lines 1450 1444 -6
==========================================
- Hits 1385 1362 -23
- Misses 65 82 +17 ☔ View full report in Codecov by Sentry. |
|
@c-allergic I refactored the interfaces for ConstraintSatisfactionProblem a bit so that it can be converted to tensor networks easier. Now we can use julia> ProblemReductions.energy_terms(IndependentSet(smallgraph(:petersen)))
25-element Vector{ProblemReductions.EnergyTerm{Int64, 2, Int64, Int64}}:
EnergyTerm
┌───┬───┬────────────┐
│ 1 │ 2 │ energy │
├───┼───┼────────────┤
│ 0 │ 0 │ 0 │
│ 1 │ 0 │ 0 │
│ 0 │ 1 │ 0 │
│ 1 │ 1 │ 3037000500 │
└───┴───┴────────────┘
EnergyTerm
┌───┬───┬────────────┐
│ 1 │ 5 │ energy │
├───┼───┼────────────┤
│ 0 │ 0 │ 0 │
│ 1 │ 0 │ 0 │
│ 0 │ 1 │ 0 │
│ 1 │ 1 │ 3037000500 │
└───┴───┴────────────┘
EnergyTerm
┌───┬───┬────────────┐
│ 1 │ 6 │ energy │
├───┼───┼────────────┤
│ 0 │ 0 │ 0 │
│ 1 │ 0 │ 0 │
│ 0 │ 1 │ 0 │
│ 1 │ 1 │ 3037000500 │
└───┴───┴────────────┘
EnergyTerm
┌───┬───┬────────────┐
│ 2 │ 3 │ energy │
├───┼───┼────────────┤
│ 0 │ 0 │ 0 │
│ 1 │ 0 │ 0 │
│ 0 │ 1 │ 0 │
│ 1 │ 1 │ 3037000500 │
└───┴───┴────────────┘
EnergyTerm
┌───┬───┬────────────┐
│ 2 │ 7 │ energy │
├───┼───┼────────────┤
│ 0 │ 0 │ 0 │
│ 1 │ 0 │ 0 │
│ 0 │ 1 │ 0 │
│ 1 │ 1 │ 3037000500 │
└───┴───┴────────────┘
EnergyTerm
┌───┬───┬────────────┐
│ 3 │ 4 │ energy │
├───┼───┼────────────┤
│ 0 │ 0 │ 0 │
│ 1 │ 0 │ 0 │
│ 0 │ 1 │ 0 │
│ 1 │ 1 │ 3037000500 │
└───┴───┴────────────┘
EnergyTerm
┌───┬───┬────────────┐
│ 3 │ 8 │ energy │
├───┼───┼────────────┤
│ 0 │ 0 │ 0 │
│ 1 │ 0 │ 0 │
│ 0 │ 1 │ 0 │
│ 1 │ 1 │ 3037000500 │
└───┴───┴────────────┘
EnergyTerm
┌───┬───┬────────────┐
│ 4 │ 5 │ energy │
├───┼───┼────────────┤
│ 0 │ 0 │ 0 │
│ 1 │ 0 │ 0 │
│ 0 │ 1 │ 0 │
│ 1 │ 1 │ 3037000500 │
└───┴───┴────────────┘
⋮
EnergyTerm
┌───┬────────┐
│ 3 │ energy │
├───┼────────┤
│ 0 │ 0 │
│ 1 │ -1 │
└───┴────────┘
EnergyTerm
┌───┬────────┐
│ 4 │ energy │
├───┼────────┤
│ 0 │ 0 │
│ 1 │ -1 │
└───┴────────┘
EnergyTerm
┌───┬────────┐
│ 5 │ energy │
├───┼────────┤
│ 0 │ 0 │
│ 1 │ -1 │
└───┴────────┘
EnergyTerm
┌───┬────────┐
│ 6 │ energy │
├───┼────────┤
│ 0 │ 0 │
│ 1 │ -1 │
└───┴────────┘
EnergyTerm
┌───┬────────┐
│ 7 │ energy │
├───┼────────┤
│ 0 │ 0 │
│ 1 │ -1 │
└───┴────────┘
EnergyTerm
┌───┬────────┐
│ 8 │ energy │
├───┼────────┤
│ 0 │ 0 │
│ 1 │ -1 │
└───┴────────┘
EnergyTerm
┌───┬────────┐
│ 9 │ energy │
├───┼────────┤
│ 0 │ 0 │
│ 1 │ -1 │
└───┴────────┘
EnergyTerm
┌────┬────────┐
│ 10 │ energy │
├────┼────────┤
│ 0 │ 0 │
│ 1 │ -1 │
└────┴────────┘ |
variablesare forced to be 1:num_variables.