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:
- removing the concept of matrix and vector size,
- 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
-
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).
-
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.
Release files for stringebraic 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| stringebraic-0.2.2.tar.gz | 6.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| stringebraic-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.2 kB
Release files / stringebraic-0.2.2.tar.gz
| Download URL | stringebraic-0.2.2.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3526741fbcd2102b9bbdce1d381c97d3407655a4aadf775a25b9ff2607b0a43d
|
|
BLAKE2b-256 checksum How to use checksums |
8285a0659568f1831da4ca3a6ceb3417767cd48e500fd17e54e29534eca8a952
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.18
|
Release files / stringebraic-0.2.2-py3-none-any.whl
| Download URL | stringebraic-0.2.2-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
97e99271956ca591a4aae5d52fd4f3e30ae97a686316c72027e5a95571accfc6
|
|
BLAKE2b-256 checksum How to use checksums |
81b902ab4623f0bd908dbfaf0f86592cd632228b442dd59a35182133dcfdd461
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.18
|