Skip to content

FastCTQW, a GPU-accelerated CTQW simulator package, with experiments demonstrating it to be the fastest among those offering direct GPU acceleration. The package covers the entire process, including Hamiltonian construction, core computations, and result visualization.

License

Notifications You must be signed in to change notification settings

Crinton/FastCTQW

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastCTQW

FastCTQW is a high-performance, GPU-accelerated Python package for simulating Continuous-Time Quantum Walks (CTQW). It delivers unparalleled speed among GPU-accelerated CTQW simulators, enabling efficient research and development.

The package offers a user-friendly Python interface, allowing researchers and developers to quickly leverage its high performance within a Python environment. FastCTQW supports Python 3.10 or newer.

Features

  • User-Friendly Interface: Provides an intuitive Python API for rapid development and validation of CTQW algorithms in virtual environments.
  • High Performance: Achieves the fastest CTQW simulations, completing a simulation on a dense graph with 10,000 nodes in under 20 seconds on a personal PC equipped with an NVIDIA GPU (8GB VRAM).
  • Numerical Stability: Ensures robust numerical stability, maintaining infidelity on the order of $10^{-12}$ in single-precision simulations for graphs with thousands of nodes, surpassing the stability of scipy.linalg.expm.

Installation

FastCTQW can be installed via PyPI or by cloning the repository and installing locally. Using a virtual environment is recommended.

PyPI Installation

pip install FastCTQW

Local Installation

git clone https://github.com/Crinton/FastCTQW.git
cd FastCTQW
pip install .

Dependencies

  • NumPy >= 1.20
  • NetworkX >= 3.0
  • SciPy >= 1.14
  • Matplotlib >= 3.5.0
  • Seaborn >= 0.11.0
  • CUDA >= 11.4
  • NVIDIA GPU with compute capability >= 7.0
  • C++17 standard

Recommended Virtual Environment Setup

conda create -n env_FastCTQW python=3.13
conda activate env_FastCTQW

Usage

Importing Required Libraries

import numpy as np
import networkx as nx
from fastCTQW.State import State
from fastCTQW.Ctqw import Ctqw

Creating a Ctqw Object from a Graph

N = 10
G = nx.random_regular_graph(d=4, n=N)
init_state = State.getUniformSuperposition(n=N)

qwalker = Ctqw.from_networkx_graph(G, init_state, device="cuda", dtype=np.complex64)

Running the Simulation and Retrieving Results

qwalker.runWalk(time=4.5)
final_state = qwalker.getFinalState()
state = final_state.getState()
print(state)

About

FastCTQW, a GPU-accelerated CTQW simulator package, with experiments demonstrating it to be the fastest among those offering direct GPU acceleration. The package covers the entire process, including Hamiltonian construction, core computations, and result visualization.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published