qiskit-tnqs is a lightweight library that enables simulation of Qiskit circuits using
TensorNetworkQuantumSimulator.jl.
There are a number of end-to-end examples for using this code in the examples folder.
Warning
This library is an interface to TensorNetworkQuantumSimulator.jl which uses belief propagation for the underlying simulation. Beyond the error introduced by normal tensor network approximations (e.g., finite bond dimension), the belief propagation ansatz is only fully accurate for a tree graph. If the graph of the circuit is not a tree, then belief propagation is only an approximation and all results should be taken with caution as they are approximate. The severity of this approximation can vary drastically and extensive testing should be done to validate it. See https://journals.aps.org/prxquantum/abstract/10.1103/PRXQuantum.5.010308 and https://arxiv.org/abs/2507.11424 for examples where extensive testing is done to quantify the accuracy of the BP approximation for a a loopy tensor network.
Once you have cloned the repository, you should be able to get started using the following steps:
- start your python env
pip install .python initial-setup.pypython examples/run_heavy_hex.py(similarly for other examples)
If you'd like to contribute, please take a look at the contribution guidelines. This project adheres to Qiskit's code of conduct. By participating, you are expected to uphold this code.
qiskit-tnqs was originally authored by
Kate Marshall, Lewis Anderson,
Ben Jaderberg and
Joey Tindall.
If you use this codebase for your research, please cite the latest version and extended author list from Zenodo: https://doi.org/10.5281/zenodo.16926968.
This project uses the Apache License 2.0. Like any other Apache 2 licensed code, you are free to use it or/and extend it.