logo

stringebraic (String-based Pauli algebraic manipulations)

Represents a Hamiltonian as a sum of Pauli strings and a quantum state as a sum of bitstrings.
Allows for a variety of operations using these strings, such as matrix-vector multiplication and inner products.

What is this? (stackoverflow)

Setup (pypi) :

pip install stringebraic

or:

python -m pip install stringebraic
This requires Python 3.8 or newer versions.

How to use:

        stringebraic <input_string_list.pkl> <input_string_coeff_list.pkl> <pauli_matrix_list.pkl> <pauli_coeff_list.pkl>
    

Show cases:

input_string_list
        ['0110', '1001']
    
input_string_coeff_list
        [(0.9964938534682489+0j), (-0.08366600265340755+0j)]
    
pauli_matrix_list
        ['IIII',
        'IIIZ',
        'IIZI',
        'IIZZ',
        'IZII',
        'IZIZ',
        'IZZI',
        'XXXX',
        'XXYY',
        'YYXX',
        'YYYY',
        'ZIII',
        'ZIIZ',
        'ZIZI',
        'ZZII']
    
pauli_coeff_list
        [(-0.5821705255474097+0j),
        (0.23528824323720435+0j),
        (-0.4535311863272902+0j),
        (0.14020450306151946+0j),
        (0.23528824323720435+0j),
        (0.18421983822358845+0j),
        (0.18133335906716103+0j),
        (0.04112885600564156+0j),
        (0.04112885600564156+0j),
        (0.04112885600564156+0j),
        (0.04112885600564156+0j),
        (-0.45353118632729017+0j),
        (0.18133335906716103+0j),
        (0.19136084924663158+0j),
        (0.14020450306151946+0j)]
    

Source

Last revised: 2025-06-10.

Ka Wa Yip
Static Badge