Metadata-Version: 2.4
Name: qif
Version: 1.4.0
Summary: Quantitative Information Flow library
Home-page: https://github.com/chatziko/libqif
Author: Kostas Chatzikokolakis  
Author-email: kostas@chatzi.org
Project-URL: Bug Tracker, https://github.com/chatziko/libqif/issues
Project-URL: Documentation, http://chatziko.github.io/libqif/
Project-URL: Source Code, https://github.com/chatziko/libqif
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: numpy
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

[![Build Status](https://github.com/chatziko/libqif/workflows/build/badge.svg)](https://github.com/chatziko/libqif/actions)
[![PyPI version](https://badge.fury.io/py/qif.svg)](https://badge.fury.io/py/qif)

# libqif

## Install

```bash
pip install qif
```

- Needs `haswell` or later CPU (AVX2)
- `python` versions supported: 3.11 to 3.15
- MacOS: 15 or later (x86_64 and arm64)


## A sample program

```python
from qif import *

def compute_bayes(C):
	pi = probab.uniform(C.shape[0])

	print("Channel:\n", C)
	print("Prior:\n", pi)

	print("Bayes vulnerability", measure.bayes_vuln.posterior(pi, C))
	print("Bayes mult-capacity", measure.bayes_vuln.mult_capacity(C))

compute_bayes(channel.randu(5))

# same, but using rational arithmetic
set_default_type(rat)

C = numpy.array([
	[rat(1,2), rat(1,4), rat(1,4)],
	[rat(1,6), rat(3,6), rat(2,6)],
	[rat(1,2), rat(1,2), rat(0)],
])
compute_bayes(C)
```

## Documentation

A list of methods provided by `qif` is available [here](http://chatziko.github.io/libqif/).

## Use libqif with C++

See the [installation instructions](INSTALL.md).
