Fix PSD Constraint Ordering for Clarabel#73
Merged
PTNobel merged 5 commits intocvxgrp:masterfrom Aug 8, 2025
Merged
Conversation
Diffcp requires that the `A` matrix conforms to the SCS format, including that PSD constraints refer to the columnwise stacking of the lower triangle. Clarabel expects that the PSD constraints refer to the upper triangle, leading to an incorrect result when using Clarabel with PSD constraints. A unit test showing the issue was added to test_clarabel. In this test, X is a 3x3 PSD matrix and we wish to minimize X00 - X22 while constraining the trace to be equal to 1. Before this change, Clarabel reports success, but the resulting matrix isn't even PSD. After this change, we get the expected result.
PTNobel
approved these changes
Aug 8, 2025
leo2www
added a commit
to leo2www/diffcp-with-mosek
that referenced
this pull request
Sep 30, 2025
* Fix: update the toy example in README.md (cvxgrp#74) * Fix PSD Constraint Ordering for Clarabel (cvxgrp#73) * Reorder PSD Constraint Rows for Clarabel Diffcp requires that the `A` matrix conforms to the SCS format, including that PSD constraints refer to the columnwise stacking of the lower triangle. Clarabel expects that the PSD constraints refer to the upper triangle, leading to an incorrect result when using Clarabel with PSD constraints. A unit test showing the issue was added to test_clarabel. In this test, X is a 3x3 PSD matrix and we wish to minimize X00 - X22 while constraining the trace to be equal to 1. Before this change, Clarabel reports success, but the resulting matrix isn't even PSD. After this change, we get the expected result. * move pytest to existing dependency group * test on larger matrix and fix bug * permute rows of b as well * fix shuffling of b matrix * Merge LPGD into diffcp (cvxgrp#67) * Update README.md * Add LPGD * Update Readme * simplify argument passing * add more lpgd examples * Catch error if perturbed problem infeasible * Give better error message on infeasibility * fix docstrings * minor changes * cosmetic changes * update readme * move perturbed solution computation to utils * cosmetics * resolve domments on pull request + minor edits * add differentiation w.r.t. P * add examples for differentiating w.r.t. P * minor cosmetic change * mention in docstring that return_dP is currently only possible in LPGD mode * Update readme for for quadratic objectives, specify when differentiation wrt P is possible. * Testing merged version, examples run but remove some ununsed imports --------- Co-authored-by: Yuwen Chen <37250191+yuwenchen95@users.noreply.github.com> Co-authored-by: Erick Fuentes <fuentes.erick@gmail.com> Co-authored-by: Anselm Paulus <40758879+a-paulus@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.