# PauliStrings.jl - Quantum many-body simulations with Pauli strings

**URL:** <https://discourse.julialang.org/t/paulistrings-jl-quantum-many-body-simulations-with-pauli-strings/121490>\
**Category:** Package Announcements\
**Tags:** package, quantum, physics\
**Created:** [October 19, 2024, 7:37pm UTC](https://discourse.julialang.org/t/paulistrings-jl-quantum-many-body-simulations-with-pauli-strings/121490 "2024-10-19T19:37:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nichola](https://avatars.discourse-cdn.com/v4/letter/n/f0a364/32.png) [@Nichola](https://discourse.julialang.org/u/Nichola)\
**Post date:** [October 19, 2024, 7:37pm UTC](https://discourse.julialang.org/t/paulistrings-jl-quantum-many-body-simulations-with-pauli-strings/121490/1 "2024-10-19T19:37:44Z")

</div>

Hi all !  
I’m happy to announce [PauliStrings.jl](https://github.com/nicolasloizeau/PauliStrings.jl) a quantum many body simulation package based on the Pauli strings representation.  
Docs : [https://paulistrings.org/](https://paulistrings.org/)  
Paper : [[2410.09654] Quantum many-body simulations with PauliStrings.jl](https://arxiv.org/abs/2410.09654)  
It’s particularity adapted for time evolving noisy spin systems, running Lanczos algorithm, and simulating systems on arbitrary geometries.  
The main idea is to store operators as a sum of Pauli strings and apply some truncation of the number of strings or string length to make simulations tractable.  
You can construct operators in a similar manner to ITensors MPO’s.  
For example, the following code constructs a XX hamiltonian and computes the first 20 lanczos coefficients:

```julia
using PauliStrings

function XX(N)
    H = Operator(N)
    for j in 1:(N - 1)
        H += "X",j,"X",j+1
        H += "Z",j,"Z",j+1
    end
    return H
end

function X(N)
    H = Operator(N)
    for j in 1:N
        H += "X",j
    end
    return H
end

N = 50 # system size (spins)
H = XX(N) # hamiltonian
O = X(N) # operator

# 20 lanczos coeficients, keep 2^20 strings at each step
b = lanczos(H, O, 20, 2^20)

```
