Skip to main content

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 Notes
===============

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


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.2.tar.gz (179.0 kB view details)

Uploaded Source

File details

Details for the file jlc_scikit_dsdp-0.2.tar.gz.

File metadata

  • Download URL: jlc_scikit_dsdp-0.2.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

Hashes for jlc_scikit_dsdp-0.2.tar.gz
Algorithm Hash digest
SHA256 f4ade9193672ed2614912236453e39c43718aa37fee6b80f0dfad1c3d643368e
MD5 28f1c34a9dd744e5211a8e11e5619f5b
BLAKE2b-256 1b1c8603ef542a87d2b1698b4ba2c01f5f0e36aa788cc9857ca44d87f0b20192

See more details on using hashes here.

Provenance

The following attestation bundles were made for jlc_scikit_dsdp-0.2.tar.gz:

Publisher: make-release.yml on jamieleecho/scikit-dsdp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page