Skip to main content

String-based Pauli algebraic manipulations

Project description

logo

PyPI - Python Version Static Badge Static Badge

stringebraic

Stringebraic is a library of methods for representing a Hamiltonian (i.e., a matrix) as a sum of Pauli strings and a quantum state (i.e., a vector) as a sum of bitstrings. This perspective allows for a variety of operations using these strings, such as matrix-vector multiplication, inner products, and other algebraic manipulations.
🐦: Why take this approach?
🐧: Because the computational complexity of these operations typically grows exponentially with the number of qubits—or, equivalently, with the size of the matrix.

In layman's terms, it automates Pauli algebra by:

  1. removing the concept of matrix and vector size,
  2. performing the matrix multiplication with string-based rules.

Input Files:

  • input_string_list.pkl – A pickle file containing a list of bitstrings that compose the quantum state.
  • input_string_coeff_list.pkl – A pickle file containing a list of coefficients that compose the quantum state.
  • pauli_matrix_list.pkl – A pickle file containing a list of Pauli strings that compose the Hamiltonian.
  • pauli_coeff_list.pkl – A pickle file containing a list of Pauli coefficients that compose the Hamiltonian.

Output:

  • The inner product value – A scalar for what the inner product (e.g., expected energy) is.

Installation

It can be installed with pip, ideally by using a virtual environment. Open up a terminal and install the package and the dependencies with:

    pip install stringebraic

or

    python -m pip install stringebraic

🐍 This requires Python 3.8 or newer versions


Steps to fast compute the inner product energy using Pauli string algebra

  1. Prepare the input files (i.e., converting the quantum Hamiltonian and quantum state into lists of strings and coefficients, as specified in the above section).

  2. Run the command to generate a inner product (i.e., a scalar):

           stringebraic input_string_list.pkl input_string_coeff_list.pkl pauli_matrix_list.pkl pauli_coeff_list.pkl


Test

You may test the installation using the sample input files (input_string_list.pkl and input_string_coeff_list.pkl, pauli_matrix_list.pkl and pauli_coeff_list.pkl) located in the test folder.


♥ Lastly executed on Python 3.10 on 2025-06-05.

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

stringebraic-0.1.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

stringebraic-0.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file stringebraic-0.1.0.tar.gz.

File metadata

  • Download URL: stringebraic-0.1.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.19

File hashes

Hashes for stringebraic-0.1.0.tar.gz
Algorithm Hash digest
SHA256 25886df7e3a18f10a0927afb200892d4e2e604f75aafb71b98c3f9a280481160
MD5 eb5117841d03d2101d3f0cc10146ca78
BLAKE2b-256 99d2b6c9cf55a0b385e6f8c47acc56fc35f0c93b13ad864ccc2b659757476154

See more details on using hashes here.

File details

Details for the file stringebraic-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: stringebraic-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.19

File hashes

Hashes for stringebraic-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49aecff1e2e5b6619d6ede5ca978200a742cc1e0d5e9a356e4b8c2b614b831ea
MD5 7ec11349af74a5a8c5dbbef0909ad7d5
BLAKE2b-256 8d6b29a641fa46a6e7f808aa723adf13cd5c3ddab602951ded44f98107834c45

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