See more in arXiv:2601.02233
This project is currently in beta. Some features are incomplete or still under development.
The following items are planned or not yet fully implemented:
-
A detailed online Documentation of PauliEngines functionality.
-
Installation via pip.
-
A comprehensive test suite.
import pauliengine as pe
# Example : Z on qubit 0 with coefficient 1.0
p1 = pe.PauliString ((1.0, {0: "Z"}))
# Example : X on qubit 1 with coefficient "a" ( symbolic )
p2 = pe.PauliString (("a", {1: "X"}))
# Example : OpenFermion style
p3 = pe.PauliString ((1.0, [("X", 0), ("Y", 2) ]))# Addition:
p4 = p2 + p3
# Multiplication
p5 = p4 * p1
# fast commutators
c = p1.commutator(p2)# create PauliString objects
p1 = pe.PauliString ((1.0 , {0: "Z"})) # not parametrized
p2 = pe.PauliString (("a", {1: "X"})) # parametrized
# assemble operator
H = QubitHamiltonian([p1 , p2 ])In beta version, mixed types need to be created like this (create atomic PauliStrings, then assemble operator)
# Differentiate
dH = H.diff ("a")
# Substitute
H2 = H.subs ({"a": 2.0})This guide explains how to install and build SymEngine and integrate it into a C++ project on Windows using Conan, CMake, and Visual Studio.
Note: When the project is built without SymEngine, runtime performance drops significantly!
Before you begin, make sure you have the following installed:
-
Git (installed and accessible from the command line)
-
CMake (installed and added to your PATH)
-
Python
Install Conan via pip:
pip install conan
conan profile detect
MacOS only
conan install --build=symengine/0.14.0Clone the project into desired directory.
pip install nanobindIn the directory src
conan install . --output-folder=build --build=missingIn the root directory
pip install .PauliEngine file can now be used in any Python project, and its functionality can be accessed via:
import pauliengine