#quantum-computing #quantum-simulation #sparse-matrix #operator #object #systems #spin

struqture

HQS tool for representing operators, Hamiltonians and open systems

38 releases (24 stable)

2.0.0-alpha.4 Nov 21, 2024
2.0.0-alpha.3 Jul 23, 2024
2.0.0-alpha.0 Apr 5, 2024
1.10.1 Nov 25, 2024
1.0.0-beta.2 Nov 11, 2022

#28 in Science

Download history 1536/week @ 2024-08-16 769/week @ 2024-08-23 991/week @ 2024-08-30 728/week @ 2024-09-06 1482/week @ 2024-09-13 2739/week @ 2024-09-20 2122/week @ 2024-09-27 1517/week @ 2024-10-04 1780/week @ 2024-10-11 1136/week @ 2024-10-18 757/week @ 2024-10-25 465/week @ 2024-11-01 278/week @ 2024-11-08 295/week @ 2024-11-15 2193/week @ 2024-11-22 1564/week @ 2024-11-29

4,419 downloads per month
Used in 24 crates (4 directly)

Apache-2.0

1MB
21K SLoC

Struqture

Struqture is a Rust (struqture) and Python (struqture-py) library by HQS Quantum Simulations to represent quantum mechanical operators, Hamiltonians and open quantum systems. The library supports building spin objects, fermionic objects, bosonic objects and mixed system objects that contain arbitrary many spin, fermionic and bosonic subsystems.

Struqture has been developed to create and exchange definitions of operators, Hamiltonians and open systems. A special focus is the use as input to quantum computing simulation software.

To best support this use case, struqture has a number of design goals:

  • Support for arbitrary spin, bosonic, fermionic and mixed systems
  • Full serialisation support to json and other formats
  • Preventing construction of unphysical objects by using well defined types for all objects in struqture
  • Support of symbolic values in operators, Hamiltonians and open systems

Following these design goals, we prioritize using distinctive types to construct objects over a less verbose syntax. Similarly the support of symbolic expression leads to a trade-off in speed compared to an implementation using only floating point values. Struqture is designed to also support the construction and (de)serialisation of large operators but for the use in numeric algorithms we recommend transforming Operators and Hamiltonians into a sparse matrix form.

Documentation

We recommend users to start with the user documentation for stuqture and struqture-py. The user documentation is intended to give a high level overview of the design and usage of struqture. For a full list of the available data types and functions see the API-Documentation of struqture and struqture-py.

Installation

Python

You can install struqture_py from PyPi. For x86 Linux, Windows and macOS systems pre-built wheels are available. On other platforms a local Rust toolchain is required to compile the Python source distribution.

pip install struqture-py

Rust

You can use struqture in your Rust project by adding

struqture = { version = "1.2" }

to your Cargo.toml file.

This project has been partly supported by PlanQK and is partially supported by QSolid and PhoQuant.

Contributing

We welcome contributions to the project. If you want to contribute code, please have a look at CONTRIBUTE.md for our code contribution guidelines.

Dependencies

~4.5MB
~91K SLoC