Skip to main content

Quantitative Information Flow library

Project description

Build Status PyPI version



pip install qif
  • Needs python >= 3.7 and a sandybridge or later CPU
  • On linux pip >= 19 is needed (make sure to pip install -U pip)

A sample program

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))


# same, but using rational arithmetic

C = np.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)],


A list of methods provided by qif is available here.

Use libqif with C++

See the installation instructions.

Project details

Download files

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

Built Distributions

qif-1.2.2-cp310-cp310-win_amd64.whl (17.7 MB view hashes)

Uploaded cp310

qif-1.2.2-cp310-cp310-macosx_10_9_x86_64.whl (13.4 MB view hashes)

Uploaded cp310

qif-1.2.2-cp39-cp39-win_amd64.whl (17.7 MB view hashes)

Uploaded cp39

qif-1.2.2-cp39-cp39-macosx_10_9_x86_64.whl (13.4 MB view hashes)

Uploaded cp39

qif-1.2.2-cp38-cp38-win_amd64.whl (17.7 MB view hashes)

Uploaded cp38

qif-1.2.2-cp38-cp38-macosx_10_9_x86_64.whl (13.4 MB view hashes)

Uploaded cp38

qif-1.2.2-cp37-cp37m-win_amd64.whl (17.7 MB view hashes)

Uploaded cp37

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page