Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chatziko/libqif
Quantitative Information Flow library for python and C++.
https://github.com/chatziko/libqif
Last synced: 3 months ago
JSON representation
Quantitative Information Flow library for python and C++.
- Host: GitHub
- URL: https://github.com/chatziko/libqif
- Owner: chatziko
- License: lgpl-2.1
- Created: 2014-01-20T14:42:58.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2024-09-03T21:34:47.000Z (5 months ago)
- Last Synced: 2024-09-19T04:19:06.168Z (5 months ago)
- Language: C++
- Homepage:
- Size: 1.54 MB
- Stars: 16
- Watchers: 8
- Forks: 9
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[![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 `python` >= 3.8 and a `sandybridge` or later CPU
- On linux `pip` >= 19 is needed (make sure to `pip install -U pip`)## 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).