Python package for performing quantum Bayesian inference
Project description
QuBayes
QuBayes is a Python package for performing quantum Bayesian inference using Qiskit. It provides a framework for representing Bayesian networks, converting them into quantum circuits, and applying them to real-world problems such as chip yield analysis.
Features
- Bayesian network representation and manipulation
- Create, modify, and analyze Bayesian networks
- Calculate node degrees and perform topological sorting
- Perform simple inference using variable elimination
- Conversion of Bayesian networks to quantum circuits using Qiskit
- Map nodes to qubits and conditional probabilities to qubit states
- Generate efficient quantum circuits ready for visualization and verification
- Inference on quantum circuits for probabilistic reasoning
- Perform inference tasks on the generated quantum circuits
- Interpret and visualize results for insights into the modeled problem
- Application to real-world problems like chip yield analysis
- Easily adapt QuBayes to analyze chip fabrication data and predict yields
- Extensible design allows for accommodating different types of chip data and analysis needs
- Modular and extensible design for easy adaptation to other domains
- Well-structured codebase following object-oriented design principles
- Documented and tested for reliability and ease of use
Installation
To install QuBayes, simply run:
pip install qubayes
Usage
Here's a simple example of how to use QuBayes to create a Bayesian network and convert it to a quantum circuit:
from qubayes.bayesnet import BayesNet
from qubayes.quantum import QuantumBayesNet
# Create a Bayesian network
bn = BayesNet()
bn.add_node('A')
bn.add_node('B')
bn.add_edge('A', 'B')
# Convert to quantum circuit
qbn = QuantumBayesNet(bn)
qc = qbn.to_circuit()
Visualize the circuit
qc.draw()
(Not implemented yet) For more detailed examples and tutorials, please see the Documentation.
Acknowledgements
QuBayes is released under the Apache License 2.0.
If you use QuBayes in your research, please cite it as follows:
@misc{QuBayes,
author = {Zi-ming Li, Zeji Li},
title = {QuBayes: A Python Package for Quantum Bayesian Inference},
year = {2024},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/BaksiLi/QuBayes}},
primaryClass = {quant-ph}
}
(Not implemented yet) Contributions to QuBayes are welcome! Please see the Contributing Guide for guidelines on how to contribute code, documentation, or bug reports.
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 qubayes-0.1.0.tar.gz.
File metadata
- Download URL: qubayes-0.1.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.19.3 CPython/3.13.0 Darwin/23.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e30564017c97ebdfd45d2e779ac5689dc5e27fe1d50f2ea17d85173a737ac69c
|
|
| MD5 |
6317da11d1469bdaae2280ddc9eda451
|
|
| BLAKE2b-256 |
3801dc8b375d5a411a61a70b9aab703e427b77f6645fe6bd30ad793a26e2cf4f
|
File details
Details for the file qubayes-0.1.0-py3-none-any.whl.
File metadata
- Download URL: qubayes-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.19.3 CPython/3.13.0 Darwin/23.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4cf3b57d85ca0dc8e4ecc9f2371369a6a6a7fb23330bc9434be6437c63ec09c3
|
|
| MD5 |
d48aed89f052cbfbf15331a229405912
|
|
| BLAKE2b-256 |
a03df7a0509d4739a6e246015d79c1ffc2ad5423f3adeae753c85e979b5e2819
|