A Python package for interacting with PyNormaliz using inequalities.
Project description
PyNormaliz_inequalities
Normaliz is a tool for various computations in discrete convex geometry. In particular it supports computations in polytopes and polyhedra specified by a system of linear inequalities. For example, it allows to compute the Hilbert or Ehrhart series of a polytope or polyhedron, and thereby count the number of integer points in it.
It is possible to interact with Normaliz using the Python package PyNormaliz, but the interface requires users to specify inequalities in a vector format. This package provides a more convenient interface for specifying inequalities in a natural format, and includes utility functions for interacting with PyNormaliz.
Installation
Normaliz and PyNormaliz must be installed on your system to use this package. You can install these packages using the following commands:
git clone https://github.com/Normaliz/Normaliz.git
cd Normaliz
./install_normaliz.sh
./install_pynormaliz.sh
To install this package, use pip:
pip install PyNormaliz_inequalities
Usage
The main point of the package is to allow users to specify inequalities in a natural format.
The main components are Variables that can be combined into Expressions and Inequalitys, which can be collected into an InequalitySystem, which can then be passed to PyNormaliz.
Example: Basic Usage
Let's count the number of integer pairs (a,b) with a + b = n that satisfy the inequalities a >= 0, b >= 0, and a + b >= 1, as a function of n.
from PyNormaliz_inequalities import Variable, InequalitySystem, evaluate_quasipolynomial
a = Variable()
b = Variable()
inequalities = InequalitySystem()
inequalities.add_inequality(a >= 0)
inequalities.add_inequality(b >= 0)
inequalities.add_inequality(a + b >= 1)
quasipolynomial = inequalities.construct_homogeneous_cone().HilbertQuasiPolynomial()
print([evaluate_quasipolynomial(quasipolynomial, n) for n in range(10)])
Explanation
The PyNormaliz_inequalities package provides a convenient interface to PyNormaliz, allowing users to specify inequalities in a natural format. It supports creating variables, expressions, and inequalities, and converting them to vector representations suitable for PyNormaliz. The package also includes functionality to construct homogeneous cones and compute Hilbert quasi-polynomials.
The main components of the package are:
Variable: Represents a variable in an inequality.Expression: Represents a linear expression involving variables.Inequality: Represents an inequality involving expressions.InequalitySystem: Manages a system of inequalities and provides methods to interact with PyNormaliz.
The package also includes utility functions for converting inequalities to vector representations and evaluating quasi-polynomials.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pynormaliz_inequalities-0.1.2.tar.gz.
File metadata
- Download URL: pynormaliz_inequalities-0.1.2.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04e8f56158e7727bf01a3bbd041dfe25872e0c5ef4754402a1888cb072ad33a4
|
|
| MD5 |
84508c165028b6c0ceedc9b6503bde3e
|
|
| BLAKE2b-256 |
b097f1aa97c33424f859dbf2ffbfb8d21a8358c74c106920ef9bed9c9c8141b9
|
Provenance
The following attestation bundles were made for pynormaliz_inequalities-0.1.2.tar.gz:
Publisher:
publish.yaml on DominikPeters/PyNormaliz_inequalities
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pynormaliz_inequalities-0.1.2.tar.gz -
Subject digest:
04e8f56158e7727bf01a3bbd041dfe25872e0c5ef4754402a1888cb072ad33a4 - Sigstore transparency entry: 156156281
- Sigstore integration time:
-
Permalink:
DominikPeters/PyNormaliz_inequalities@29cfa68402f05be4c1fc85726957933770634f68 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/DominikPeters
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@29cfa68402f05be4c1fc85726957933770634f68 -
Trigger Event:
push
-
Statement type:
File details
Details for the file PyNormaliz_inequalities-0.1.2-py3-none-any.whl.
File metadata
- Download URL: PyNormaliz_inequalities-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
079622af75279191a734076e1960b3cabecdf7cd97ec996b9aa00cd1ac16141e
|
|
| MD5 |
c9131155fb63c1a7e853af01350fc946
|
|
| BLAKE2b-256 |
6e27f6c1bd2dfc5df24f363f717da35e4126203cd0e27d2ca1ed8bbe0c7d3141
|
Provenance
The following attestation bundles were made for PyNormaliz_inequalities-0.1.2-py3-none-any.whl:
Publisher:
publish.yaml on DominikPeters/PyNormaliz_inequalities
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pynormaliz_inequalities-0.1.2-py3-none-any.whl -
Subject digest:
079622af75279191a734076e1960b3cabecdf7cd97ec996b9aa00cd1ac16141e - Sigstore transparency entry: 156156282
- Sigstore integration time:
-
Permalink:
DominikPeters/PyNormaliz_inequalities@29cfa68402f05be4c1fc85726957933770634f68 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/DominikPeters
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@29cfa68402f05be4c1fc85726957933770634f68 -
Trigger Event:
push
-
Statement type: