Skip to main content

A framework for tensor-network–based quantum annealing simulation powered by belief propagation.

Project description

What is it?

This is a package for large scale tensor-networks-based simulation of quantum annealing. It uses belief propagation based approximate inference (see https://arxiv.org/abs/2306.17837, https://arxiv.org/abs/2409.12240, https://arxiv.org/abs/2306.14887) as an engine. This implementation introduces a compilation step that classifies graph nodes by degree, groups the corresponding tensors into batched representations, groups the associated messages, enabling massively parallel belief propagation and related subroutines easelly deployable on a GPU.

How to install?

  1. Clone this repo;
  2. Run pip install . from the clonned repo under your python environment.

To validate the computation results, some examples and tests rely on an exact quantum circuit simulator available at https://github.com/LuchnikovI/qem. To install it, follow the steps below:

  1. Clone the repo https://github.com/LuchnikovI/qem;
  2. Install rust (see https://rust-lang.org/tools/install/);
  3. Install maturin by running pip install maturin .;
  4. Run pip install . from the clonned repo under your python environment.

How to use?

This package exposes a single entry point, run_qa, which executes the full workflow. It accepts a single argument which is a Python dictionary that fully specifies the quantum annealing task. This dictionary serves as a configuration or DSL and can be directly deserialized from JSON or other formats. For a concrete example of the configuration, see ./examples/small_ibm_heavy_hex.py.

How to run benchmarks against MQLib?

First, one need to install an MQLib wrapper awailable here, follow the instruction of README there. Now one can execute scripts in ./benchmarks_against_mqlib, every script saves a result into a separate directory with time stamp.

Available backends

Currently there are numpy and cupy backends. One can specify it in the configuration dictionary. To use cupy backend one needs to install cupy sepraratelly since it is not in the dependancies list. One can control the precision of the numpy backend by setting the environment variable export BQA_PECISION=single for the single precision and export BQA_PRECISION=double for the double precision. The precision of the cupy backend is always single. This is important to trigger fast batched matrix multiplication kernel.

Project details


Download files

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

Source Distribution

bqa-0.1.4.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bqa-0.1.4-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file bqa-0.1.4.tar.gz.

File metadata

  • Download URL: bqa-0.1.4.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.12.12 Linux/6.14.0-1017-azure

File hashes

Hashes for bqa-0.1.4.tar.gz
Algorithm Hash digest
SHA256 d1b45e37b8f442d84a0b28af63ad5d8bb781f7b0af5f35e9cc2b2d4efa500877
MD5 b0f540fb43d4b9f234e2936b107bffef
BLAKE2b-256 9fa6cdd3750f814122aeeab6f14eef96d9d229736d2d57193dc28ccc49412282

See more details on using hashes here.

File details

Details for the file bqa-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: bqa-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.12.12 Linux/6.14.0-1017-azure

File hashes

Hashes for bqa-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c92b3fd34f147d832e55e86c672b938e47f98bf2c35714a41bdde04d21639fef
MD5 902230e94eda8b9881a188acd8220900
BLAKE2b-256 1758574456cef9a899d976827599a0b6a1fedcddc2aac0edacc9eebb6dd50273

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page