|
libtma 0.3.13-dev.9013
QE C++ library
|
Plain-data packers for libtma results in nanobind (Python) bindings. More...
#include <libqe/bind/nanobind.hpp>#include <libtma/accumulation.hpp>#include <nanobind/stl/string.h>#include <nanobind/stl/variant.h>#include <nanobind/stl/vector.h>#include <string>#include <variant>#include <vector>Go to the source code of this file.
Namespaces | |
| namespace | qe |
| namespace | qe::bind |
| namespace | qe::bind::py |
Plain-data packers for libtma results in nanobind (Python) bindings.
Results cross the boundary as dicts of numpy arrays, not registered nanobind classes, so extension modules built by different products (qe-tma, qe-ena, ...) can be loaded together without type-registration clashes. Python-side result classes (tma.libtma.UnitNetworks, TensorNetworks) wrap the dicts to keep attribute access.
It also holds the bindings themselves, one registration function per libtma function (def_<name>, plus def_libtma for all of them), so every module that exposes them – qe-tma's tma._libtma, qe-ena's ena._libena – shares one definition (signature, defaults, docstring) and picks the ones it needs.
Requires nanobind; never included by libtma.hpp. Array conversion comes from libqe/bind/nanobind.hpp.