Skip to main content

Maniverse

Numerical optimization on manifolds

Overview

Maniverse is a library for optimization on manifolds (OOM).

What is Maniverse intended for?

I wrote Maniverse primarily for my quantum chemistry packages Chinium and Orbaplaw, which take care of some classic constraints in quantum chemistry via OOM. However, Maniverse is intended for more general use than merely quantum chemistry.

Why another library for OOM?

The two packages mentioned above are written in C++ and Python separately, so I hoped to have a single library for both C++ and Python. As far as I know, none of the existing libraries are 2-in-1.

How will Maniverse be maintained?

Optimization on manifolds has two aspects: the manifolds and the optimization algorithms. Therefore, this question should be divided into two: how will the two aspects be maintained separately?

For the manifolds, as a quantum chemist, I focused more on the Stiefel manifold and the Grassmann manifold (and their derivatives), so major emphasis will be laid on these two. However, users are welcomed to give advice on more manifolds to be supported. Additionally, Maniverse provides a base class Manifold from which users can derive their own manifold class.

For the optimization algorithms, the attention is paid to the second-order methods, because nearly all the functions to be optimized in quantum chemistry are smooth and well-behaved. These methods include Riemannian trust region method and Riemannian BFGS. I would like to keep track of the popular field of OOM and implement more efficient algorithms as they are being proposed, as long as they enhance the performance in my projects on quantum chemistry.

Are you an expert on OOM?

No. It has just occurred to me that OOM can be extremely powerful in some topics in quantum chemistry in middle 2024, so I set out to develop Maniverse. However, my knowledge in OOM is deficient, and I am still learning through textbooks, papers and discussions on webs. For helping make Maniverse real, I have a long namelist to thank. The good thing is that the current codes do work as they are expected, at least in my projects.

Features

Manifolds

  • Stiefel manifold and its derivatives (Flag, Grassmann, Orthogonal)
  • Simplex manifold
  • User-defined manifolds
  • Any products of the manifolds above

Optimizers

  • Trust-region Newton's method with conjugate gradient or minimal residual as the linear subproblem solver
  • L-BFGS
  • Anderson acceleration (rarely used; not fully tested yet)
  • Augmented Lagrangian method for extra non-manifold constraints with one of the unconstrained optimizers above for internal optimization

Linear system solvers

  • Conjugate gradient
  • Minimal residual

They can be set to be vigilant about non-positive curvatures in the Hessian and aware of the trust region in Newton's method. Preconditioners can be applied to both methods.

Diagonalizers

  • Lanczos method (for stability check of solutions to constrained and unconstrained optimization problems)

Prerequisites

  • A C++ compiler that supports C++17 standard
  • GNU make
  • Eigen3 >= 3.4.90
  • PyBind11 >= 2.13.6 (For interface to python)
  • Python3 with numpy (For interface to python)

Installation

Manual build

  • Downloading the latest stable release
$ wget https://github.com/FreemanTheMaverick/Maniverse/archive/refs/tags/v0.3.5.tar.gz
  • Edit the first few lines of /Maniverse/makefile for your own computer configuration, including
    • the commands that call the C++ compiler, the GNU make and ar
    • the option that indicates whether to build for C++ use or python use
    • the directories that contain the necessary libraries
  • make -j[N] and you will find the newly created directories /Maniverse/include and /Maniverse/lib.
  • Utilize Maniverse in your project
    • For C++,
      $ g++ test.cpp -isystem $(MANIVERSE)/include/ -L$(MANIVERSE)/lib/ -l:libmaniverse.a # Static linking
      $ g++ test.cpp -isystem $(MANIVERSE)/include/ -L$(MANIVERSE)/lib/ -lmaniverse # Shared linking
      
    • For Python,
      $ export PYTHONPATH=$PYTHONPATH:$(MANIVERSE)/lib/
      $ python
      >>> import Maniverse as mv
      

Pip (for Python only)

  • Installation with pip
pip install Maniverse

Usually pip installs packages to a lib/ directory that is already in $PYTHONPATH, so you do not need to set the environment variable for Maniverse.

  • Utilize Maniverse in your project
$ python
>>> import Maniverse as mv

Metadata

Release files for Maniverse 2.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for Maniverse 2.3.0
File Actions
maniverse-2.3.0-cp313-cp313-musllinux_1_2_x86_64.whl CPython 3.13 CPython 3.13 Linux musl 1.2+ x86-64 Details for maniverse-2.3.0-cp313-cp313-musllinux_1_2_x86_64.whl
maniverse-2.3.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for maniverse-2.3.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
maniverse-2.3.0-cp312-cp312-musllinux_1_2_x86_64.whl CPython 3.12 CPython 3.12 Linux musl 1.2+ x86-64 Details for maniverse-2.3.0-cp312-cp312-musllinux_1_2_x86_64.whl
maniverse-2.3.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for maniverse-2.3.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
maniverse-2.3.0-cp311-cp311-musllinux_1_2_x86_64.whl CPython 3.11 CPython 3.11 Linux musl 1.2+ x86-64 Details for maniverse-2.3.0-cp311-cp311-musllinux_1_2_x86_64.whl
maniverse-2.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for maniverse-2.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
maniverse-2.3.0-cp310-cp310-musllinux_1_2_x86_64.whl CPython 3.10 CPython 3.10 Linux musl 1.2+ x86-64 Details for maniverse-2.3.0-cp310-cp310-musllinux_1_2_x86_64.whl
maniverse-2.3.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for maniverse-2.3.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
maniverse-2.3.0-cp39-cp39-musllinux_1_2_x86_64.whl CPython 3.9 CPython 3.9 Linux musl 1.2+ x86-64 Details for maniverse-2.3.0-cp39-cp39-musllinux_1_2_x86_64.whl
maniverse-2.3.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for maniverse-2.3.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Total release size: 18.3 MB

Release files / maniverse-2.3.0-cp313-cp313-musllinux_1_2_x86_64.whl

Download URL maniverse-2.3.0-cp313-cp313-musllinux_1_2_x86_64.whl
Size 2.4 MB
Tags CPython 3.13 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
7a9272416fd3b7ae1237201b4d7848db7a2878ff7d95a46f991a6317a337fb8f
BLAKE2b-256 checksum
How to use checksums
3cbdcbb244dd0b773a5fbb2e6e9836e7f6c638bcf57b13bafa4b56d11a40b8d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / maniverse-2.3.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL maniverse-2.3.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.3 MB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d85c4f121a0bb92aad4688cf068078772659fc2e3e24701e0adecd0fb7a674bc
BLAKE2b-256 checksum
How to use checksums
dd4830a91ca7e8d03be4d59445ef33ec60d6d443e2d4b5ffcbdc07554da8505e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / maniverse-2.3.0-cp312-cp312-musllinux_1_2_x86_64.whl

Download URL maniverse-2.3.0-cp312-cp312-musllinux_1_2_x86_64.whl
Size 2.4 MB
Tags CPython 3.12 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
bc9e9cc875f9edde15d3ef4123e44db88fc333e367ca2e500dd2a8d5b9b74387
BLAKE2b-256 checksum
How to use checksums
4807fd109ee1b2d2ef2881464d42a8fc64e54545fb5a026b670cd0aef8d40dcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / maniverse-2.3.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL maniverse-2.3.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.3 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
983a2d3e1720ba7d0571adf73dc7eb8ec016f2408c1b07b00b5615125d6c7199
BLAKE2b-256 checksum
How to use checksums
04fc3699403c16fd9c0627195f60948d7eec44194af46d74dc81fe51cb03fa73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / maniverse-2.3.0-cp311-cp311-musllinux_1_2_x86_64.whl

Download URL maniverse-2.3.0-cp311-cp311-musllinux_1_2_x86_64.whl
Size 2.4 MB
Tags CPython 3.11 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
a998aaa79c54e0f7b79c2dceb743691697c6e9af63ea1ef15c9c3d548bfaf4bb
BLAKE2b-256 checksum
How to use checksums
7e1b7f58ca83df2127b8b6d08b2b55b74439ee7d339578a349c21bcca93999fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / maniverse-2.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL maniverse-2.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.3 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
0360488f7e51f0847a667135b454fb25e220829eeee8b00bdd4dfa07d13086fd
BLAKE2b-256 checksum
How to use checksums
1574c52d1832aab26265a8ed7e74fe6aa86168f292378b6b3f9bcf68697139b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / maniverse-2.3.0-cp310-cp310-musllinux_1_2_x86_64.whl

Download URL maniverse-2.3.0-cp310-cp310-musllinux_1_2_x86_64.whl
Size 2.4 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
802f25abcbc0ebe837467d49d88e55c5ff40d5d8875e93433ec4d3e194367349
BLAKE2b-256 checksum
How to use checksums
9a0a172a6955ee7f88ba5208be032668bb72780dff9ec71ce17c11f46c4234ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / maniverse-2.3.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL maniverse-2.3.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.3 MB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
a5563899e0b5c6e9358749154fdfcf8df9459a4cccee1e29be0a896a418811db
BLAKE2b-256 checksum
How to use checksums
7284423bdb628174f0a25fc86519f55f965d46a42d5071ce306dba0785fd4888
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / maniverse-2.3.0-cp39-cp39-musllinux_1_2_x86_64.whl

Download URL maniverse-2.3.0-cp39-cp39-musllinux_1_2_x86_64.whl
Size 2.4 MB
Tags CPython 3.9 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
f03654603ecd04f386e007e54a06a8e5bb6da4bc25b67ea254a3ea675d83a8de
BLAKE2b-256 checksum
How to use checksums
7c204dcac9327fbe8ff7046800c693bdfb8f22e78524e4b722c8f07ecccf8479
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / maniverse-2.3.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL maniverse-2.3.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.3 MB
Tags CPython 3.9 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
cbab45d3c78275fa503fb2c0ba38c5271b77838f1cfd6e15d54cafe54e625d4e
BLAKE2b-256 checksum
How to use checksums
18daccd19f0fe8a01892bf025512a0a99f87f0ca47bc6cc2dc61c986b64de53e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for Maniverse 2.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page