Python interface to DSDP semidefinite programming library
Project description
scikit-dsdp
==============
scikit-dsdp provides Python interface to DSDP semidefinite programming library. The DSDP package implements a dual-scaling algorithm to find solutions (X, y) to linear and semidefinite optimization problems of the form
inf tr(CX)
subject to AX = b
X >= 0
with (AX)_i = tr(A_iX) where X >= 0 means X is positive semidefinite, C and all A_i are symmetric matrices of the same size and b is a vector of length m.
The dual of the problem is
sup b'y
subject to A'y + S = C
S >= 0
where A'y = \sum_{i=1}^m y_i A_i.
Matrices C and A_i are assumed to be block diagonal structured, and must be specified that way (see Details).
Example
============
from pydsdp.dsdp5 import dsdp
from numpy import matrix
A = matrix([
[10, 4, 4, 0],
[0, 0, 0, -8],
[0, -8, -8, -2]])
b = matrix ([
[48] ,
[-8],
[20]])
c = matrix ([
[-11] ,
[0] ,
[0] ,
[23]])
K = {} # K is a dictionary for sizes of different cones
K['s'] = [2]
result = dsdp(A, b, c, K)
Dependencies
============
scikit-dsdp depends on NumPy and SciPy.
Install
=======
pip install scikit-dsdp
Development
===========
Code
----
You can check the latest sources with the command::
git clone https://github.com/zhisu/scikit-dsdp.git
or if you have write privileges::
git clone git@github.com:zhisu/scikit-dsdp.git
cd scikit-dsdp
make install-pre-commit
make install
Testing
-------
make run-tests
Misc
-------
The Makefile makes it easy to perform the most common operations:
* make check-all # runs linting and uv.lock checks
* make check-lint # checks for linting issues
* make check-lock # verifies the uv.lock is aligned to pyproject.toml
* make clean # cleans the virtual environment and caches
* make default # runs a default set of checks on the code
* make fix-all # formats the code, fixes lint errors and runs locks uv.lock to pyproject.toml
* make fix-format # formats the code
* make fix-lint # fixes linting issues
* make fix-lint-unsafe # fixes linting issues potentially adding inadvertant bugs
* make help # outputs the different make options
* make install # build install the distribution
* make install-pre-commit # installs pre-commit hooks
* make lock # locks uv.lock to pyproject.toml
* make install-pre-commit # installs pre-commit hooks
* make run-tests # runs the unit tests
* make sync # syncs the python environment with uv.lock
.vscode/settings.json is set so that unit tests can be run without further configuration.
Releasing
============
If you have sufficient permissions, you will be able to make new releases that are published to
https://pypi.org/project/scikit-dsdp/
Releases are made from the main branch.
1. Select Run workflow from https://github.com/zhisu/scikit-dsdp/actions/workflows/bump-version.yml
2. Be sure that the main branch is selected and press Run workflow
3. This will automatically create a new tag and publish to pypi
4. A new release will be present https://github.com/zhisu/scikit-dsdp/releases that you can then fill out and publish.
Important Note
==============
This modules was originally developed by zhisu and the original repo can be found at
https://github.com/zhisu/scikit-dsdp
This fork is being maintained by jamieleecho.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jlc_scikit_dsdp-0.3.tar.gz
(179.0 kB
view details)
File details
Details for the file jlc_scikit_dsdp-0.3.tar.gz.
File metadata
- Download URL: jlc_scikit_dsdp-0.3.tar.gz
- Upload date:
- Size: 179.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ce8f30a45cc3f51a897392fddc60c524115fb821b552be4573ecb7e094e5ad5
|
|
| MD5 |
2646994aef835c71cc8e54277e63c14f
|
|
| BLAKE2b-256 |
842ab47b382eb71ef2bc77d23d109fb4818416526d6321a79072251650d607dd
|
Provenance
The following attestation bundles were made for jlc_scikit_dsdp-0.3.tar.gz:
Publisher:
make-release.yml on jamieleecho/scikit-dsdp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jlc_scikit_dsdp-0.3.tar.gz -
Subject digest:
6ce8f30a45cc3f51a897392fddc60c524115fb821b552be4573ecb7e094e5ad5 - Sigstore transparency entry: 191320500
- Sigstore integration time:
-
Permalink:
jamieleecho/scikit-dsdp@24bbedf92e579b6eaea2df067a7c47c55b4e32da -
Branch / Tag:
refs/tags/0.3 - Owner: https://github.com/jamieleecho
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
make-release.yml@24bbedf92e579b6eaea2df067a7c47c55b4e32da -
Trigger Event:
workflow_dispatch
-
Statement type: