Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pynormaliz_inequalities-0.1.2.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PyNormaliz_inequalities-0.1.2-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

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

Hashes for pynormaliz_inequalities-0.1.2.tar.gz
Algorithm Hash digest
SHA256 04e8f56158e7727bf01a3bbd041dfe25872e0c5ef4754402a1888cb072ad33a4
MD5 84508c165028b6c0ceedc9b6503bde3e
BLAKE2b-256 b097f1aa97c33424f859dbf2ffbfb8d21a8358c74c106920ef9bed9c9c8141b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pynormaliz_inequalities-0.1.2.tar.gz:

Publisher: publish.yaml on DominikPeters/PyNormaliz_inequalities

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

File details

Details for the file PyNormaliz_inequalities-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for PyNormaliz_inequalities-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 079622af75279191a734076e1960b3cabecdf7cd97ec996b9aa00cd1ac16141e
MD5 c9131155fb63c1a7e853af01350fc946
BLAKE2b-256 6e27f6c1bd2dfc5df24f363f717da35e4126203cd0e27d2ca1ed8bbe0c7d3141

See more details on using hashes here.

Provenance

The following attestation bundles were made for PyNormaliz_inequalities-0.1.2-py3-none-any.whl:

Publisher: publish.yaml on DominikPeters/PyNormaliz_inequalities

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