A BDD-based C++ library for set operations on multi-qubit Pauli operators
git clone https://github.com/fmlab-iis/spbdd
cd spbdd
makeThis step produces the static library build/libspbdd.a. Note that this step also automatically fetches BuDDy, the BDD backend used in this library.
To use this library in your C++ program, you only need :
include/spbdd/folder, which contains the library headers.build/libspbdd.a, which is the static library archive.
Copy them next to your prog.cpp:
.
├── prog.cpp
├── spbdd/ <- copied from include/spbdd/
└── libspbdd.a <- copied from build/libspbdd.a
Here is an example program prog.cpp:
#include "spbdd/spbdd.hpp" // the only header you need
#include <iostream>
int main() {
spbdd::context ctx(2);
spbdd::pset s = ctx.from_list({"XI", "ZZ"});
std::cout << (s * s).size() << std::endl; // stdout: 2 ({II, YZ})
}To compile, you only need to link libspbdd.a. Note that this library requires at least C++17.
g++ -std=c++17 prog.cpp libspbdd.a -o progPlease create an issue for bug reports and feature requests, or contact us directly at jtsai1120@gmail.com.