feat: Quadratic constraints#523
Conversation
|
wonderful initiative! let me know when I should take a first look |
|
@FabianHofmann Its ready for an initial review. I would be happy if you give me some quick feedback on what functionality is missing (if some), so i wont get lost in details. I will revisit the new tests tomorrow. |
|
From my analysis the QuadraticConstraint class is missing several wrapped xarray methods that Constraint has:
These are definitely a todo imo |
resolved |
|
@FabianHofmann My PR includes a "fix" regarding the |
|
Consider merging #528 beforehand and update this accordingly for better solver support checking and better error messages |
|
I didnt find the the time to continue on this. |
|
All good! This is not pressing. But we might want to tackle it in the upcoming weeks. I'll let you know as soon as we prioritize this |
Closes #444
Changes proposed in this Pull Request
This PR adds comprehensive quadratic constraints support to linopy, enabling optimization problems of the form x'Qx + a'x ≤ b.
New Features
Core quadratic constraint infrastructure:
Solver support:
File I/O:
Matrix representations:
Additional:
Before Merging:
Remove dev-scripts
The dev-scripts/ directory contains planning documents that were committed but should be removed before merging (per CLAUDE.md, dev-scripts is for non-tracked
temporary code). Would you like me to create a commit removing those files?
Review and documentation
As this is quite a big feature, i would be happy if someone that understands the codebase more deeply than i do goes into detail and verifies my code, especially the matrix computation. Also, including examples and explanations into the docs would be appropriate
Solver capabilities
Im not entirely sure if SCIP supports MIQCQP. In my tests i got an LP read error.
Dual values can only be retrived for convex models. For gurobi, we need to set
QCPDual=1. Other solvers might need other settings. this is not set automatically.Follow Ups
Checklist
doc.doc/release_notes.rstof the upcoming release is included.