dependabot[bot] 8cbad55010 chore(deps-dev): bump requests from 2.32.3 to 2.32.4
Bumps [requests](https://github.com/psf/requests) from 2.32.3 to 2.32.4.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.32.3...v2.32.4)

---
updated-dependencies:
- dependency-name: requests
  dependency-version: 2.32.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 05:48:34 +00:00
2025-04-22 11:06:23 +02:00
2025-02-17 12:11:59 +01:00
2025-09-04 10:35:27 +08:00
2024-04-10 15:59:17 +02:00
2024-02-15 12:22:45 +08:00
2024-03-14 10:59:17 +01:00
2022-06-23 03:59:55 +00:00

Qibotn

The tensor network translation module for Qibo to support large-scale simulation of quantum circuits and acceleration.

Supported Computation

Tensor Network Types:

  • Tensornet (TN)
  • Matrix Product States (MPS)

Tensor Network contractions to:

  • dense vectors
  • expecation values of given Pauli string

The supported HPC configurations are:

  • single-node CPU
  • single-node GPU or GPUs
  • multi-node multi-GPU with Message Passing Interface (MPI)
  • multi-node multi-GPU with NVIDIA Collective Communications Library (NCCL)

Currently, the supported tensor network libraries are:

  • cuQuantum, an NVIDIA SDK of optimized libraries and tools for accelerating quantum computing workflows.
  • quimb, an easy but fast python library for quantum information many-body calculations, focusing primarily on tensor networks.

Installation

To get started:

pip install qibotn

to install the tools and dependencies. A few extras are provided, check pyproject.toml in case you need them.

Contribute

To contribute, please install using poetry:

git clone https://github.com/qiboteam/qibotn.git
cd qibotn
poetry install

Sample Codes

Single-Node Example

The code below shows an example of how to activate the Cuquantum TensorNetwork backend of Qibo.

import numpy as np
from qibo import Circuit, gates
import qibo

# Below shows how to set the computation_settings
# Note that for MPS_enabled and expectation_enabled parameters the accepted inputs are boolean or a dictionary with the format shown below.
# If computation_settings is not specified, the default setting is used in which all booleans will be False.
# This will trigger the dense vector computation of the tensornet.

computation_settings = {
    "MPI_enabled": False,
    "MPS_enabled": {
        "qr_method": False,
        "svd_method": {
            "partition": "UV",
            "abs_cutoff": 1e-12,
        },
    },
    "NCCL_enabled": False,
    "expectation_enabled": False,
}


qibo.set_backend(
    backend="qibotn", platform="cutensornet", runcard=computation_settings
)  # cuQuantum
# qibo.set_backend(backend="qibotn", platform="qutensornet", runcard=computation_settings) #quimb


# Construct the circuit
c = Circuit(2)
# Add some gates
c.add(gates.H(0))
c.add(gates.H(1))

# Execute the circuit and obtain the final state
result = c()

print(result.state())

Other examples of setting the computation_settings

# Expectation computation with specific Pauli String pattern
computation_settings = {
    "MPI_enabled": False,
    "MPS_enabled": False,
    "NCCL_enabled": False,
    "expectation_enabled": {
        "pauli_string_pattern": "IXZ",
    },
}

# Dense vector computation using multi node through MPI
computation_settings = {
    "MPI_enabled": True,
    "MPS_enabled": False,
    "NCCL_enabled": False,
    "expectation_enabled": False,
}

Multi-Node Example

Multi-node is enabled by setting either the MPI or NCCL enabled flag to True in the computation settings. Below shows the script to launch on 2 nodes with 2 GPUs each. $node_list contains the IP of the nodes assigned.

mpirun -n 4 -hostfile $node_list python test.py
Description
No description provided
Readme 1.7 MiB
Languages
Python 98.6%
Nix 1.4%