stringebraic


Namestringebraic JSON
Version 0.2.2 PyPI version JSON
download
home_pageNone
SummaryString-based Pauli algebraic manipulations
upload_time2025-08-25 01:13:43
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2025 Ka Wa Yip Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords pauli quantum inner product
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
              <figure>
    <img src="https://github.com/kwyip/stringebraic/blob/main/logo.png?raw=True" alt="logo" height="143" />
  </figure>

[![](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/kwyip/stringebraic/blob/main/LICENSE)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/stringebraic)](https://pypi.org/project/stringebraic/)
[![Static Badge](https://img.shields.io/badge/CalVer-2025.0416-ff5733)](https://pypi.org/project/stringebraic)
[![Static Badge](https://img.shields.io/badge/PyPI-wheels-d8d805)](https://pypi.org/project/stringebraic/#files)
[![](https://pepy.tech/badge/stringebraic/month)](https://pepy.tech/project/stringebraic)

[stringebraic](https://stringebraic.github.io/)
===============================================

Stringebraic is a library of methods for representing a Hamiltonian (i.e., a matrix) as a sum of Pauli *string*s and a quantum state (i.e., a vector) as a sum of *bitstring*s. This perspective allows for a variety of operations using these *string*s, 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&#39;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](https://docs.python.org/3/library/pickle.html)
        file containing a list of bitstrings that compose the quantum state.</li>
*   `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](https://realpython.com/what-is-pip/#using-pip-in-a-python-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](#input-files))**.
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.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "stringebraic",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "Pauli, quantum, inner product",
    "author": null,
    "author_email": "Ka Wa Yip <yipkawa@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/82/85/a0659568f1831da4ca3a6ceb3417767cd48e500fd17e54e29534eca8a952/stringebraic-0.2.2.tar.gz",
    "platform": null,
    "description": "  <figure>\n    <img src=\"https://github.com/kwyip/stringebraic/blob/main/logo.png?raw=True\" alt=\"logo\" height=\"143\" />\n  </figure>\n\n[![](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/kwyip/stringebraic/blob/main/LICENSE)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/stringebraic)](https://pypi.org/project/stringebraic/)\n[![Static Badge](https://img.shields.io/badge/CalVer-2025.0416-ff5733)](https://pypi.org/project/stringebraic)\n[![Static Badge](https://img.shields.io/badge/PyPI-wheels-d8d805)](https://pypi.org/project/stringebraic/#files)\n[![](https://pepy.tech/badge/stringebraic/month)](https://pepy.tech/project/stringebraic)\n\n[stringebraic](https://stringebraic.github.io/)\n===============================================\n\nStringebraic is a library of methods for representing a Hamiltonian (i.e., a matrix) as a sum of Pauli *string*s and a quantum state (i.e., a vector) as a sum of *bitstring*s. This perspective allows for a variety of operations using these *string*s, such as matrix-vector multiplication, inner products, and other algebraic manipulations.  \n\ud83d\udc26: Why take this approach?  \n\ud83d\udc27: Because the computational complexity of these operations typically grows exponentially with the number of qubits\u2014or, equivalently, with the size of the matrix.\n\nIn layman&#39;s terms, it automates Pauli algebra by:\n\n1.  removing the concept of matrix and vector size,\n2.  performing the matrix multiplication with string-based rules.\n\n#### Input Files:\n\n*   `input_string_list.pkl` \u2013 A [pickle](https://docs.python.org/3/library/pickle.html)\n        file containing a list of bitstrings that compose the quantum state.</li>\n*   `input_string_coeff_list.pkl` \u2013 A pickle file containing a list of coefficients that compose the quantum state.\n*   `pauli_matrix_list.pkl` \u2013 A pickle file containing a list of Pauli strings that compose the Hamiltonian.\n*   `pauli_coeff_list.pkl` \u2013 A pickle file containing a list of Pauli coefficients that compose the Hamiltonian. \n\n#### Output:\n\n*   `The inner product value` \u2013 A scalar for what the inner product (e.g., expected energy) is.\n\n* * *\n\nInstallation\n------------\n\nIt can be installed with `pip`, ideally by using a [virtual environment](https://realpython.com/what-is-pip/#using-pip-in-a-python-virtual-environment). Open up a terminal and install the package and the dependencies with:  \n  \n\n\u00a0\u00a0\u00a0\u00a0`pip install stringebraic`\n\n_or_\n\n\u00a0\u00a0\u00a0\u00a0`python -m pip install stringebraic`\n\n  \n_\ud83d\udc0d This requires Python 3.8 or newer versions_\n\n* * *\n\n### Steps to fast compute the inner product energy using Pauli *string* algebra\n\n1.  **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](#input-files))**.\n2.  **Run the command to generate a inner product (i.e., a scalar)**:  \n      \n    \n    \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0`stringebraic input_string_list.pkl input_string_coeff_list.pkl pauli_matrix_list.pkl pauli_coeff_list.pkl`\n\n\n* * *\n\n### Test\n\nYou may test the installation using the sample input files (`input_string_list.pkl` and\n    `input_string_coeff_list.pkl`, `pauli_matrix_list.pkl` and `pauli_coeff_list.pkl`) located in the test folder.\n\n---\n\n\u2665 Lastly executed on Python `3.10` on 2025-06-05.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2025 Ka Wa Yip  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "String-based Pauli algebraic manipulations",
    "version": "0.2.2",
    "project_urls": {
        "Homepage": "https://github.com/kwyip/stringebraic",
        "Issues": "https://github.com/kwyip/stringebraic/issues"
    },
    "split_keywords": [
        "pauli",
        " quantum",
        " inner product"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "81b902ab4623f0bd908dbfaf0f86592cd632228b442dd59a35182133dcfdd461",
                "md5": "20519e9e4f4ff0f1d05a72ef506f05db",
                "sha256": "97e99271956ca591a4aae5d52fd4f3e30ae97a686316c72027e5a95571accfc6"
            },
            "downloads": -1,
            "filename": "stringebraic-0.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "20519e9e4f4ff0f1d05a72ef506f05db",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 6028,
            "upload_time": "2025-08-25T01:13:41",
            "upload_time_iso_8601": "2025-08-25T01:13:41.890850Z",
            "url": "https://files.pythonhosted.org/packages/81/b9/02ab4623f0bd908dbfaf0f86592cd632228b442dd59a35182133dcfdd461/stringebraic-0.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8285a0659568f1831da4ca3a6ceb3417767cd48e500fd17e54e29534eca8a952",
                "md5": "097aa577a3ab7e803e33bd6e2b2eb614",
                "sha256": "3526741fbcd2102b9bbdce1d381c97d3407655a4aadf775a25b9ff2607b0a43d"
            },
            "downloads": -1,
            "filename": "stringebraic-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "097aa577a3ab7e803e33bd6e2b2eb614",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 6201,
            "upload_time": "2025-08-25T01:13:43",
            "upload_time_iso_8601": "2025-08-25T01:13:43.112927Z",
            "url": "https://files.pythonhosted.org/packages/82/85/a0659568f1831da4ca3a6ceb3417767cd48e500fd17e54e29534eca8a952/stringebraic-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-25 01:13:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kwyip",
    "github_project": "stringebraic",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "stringebraic"
}
        
Elapsed time: 1.15367s