qbm/backends/tensor_network.py::_decompose raises for any generator acting on more than two sites:
generator {label} acts on N sites; the tensor-network backend supports
1- and 2-body Pauli generators only
That is a real restriction rather than a fundamental one — it exists because the Trotter gates are built as explicit 1- or 2-site matrices. Models built with pauli_pool(n, locality=3), or any 3-body coupling, simply cannot use this backend.
What to do
Either apply a k-site gate as an MPO, or decompose the k-body Pauli rotation into a CNOT-ladder of 2-site gates (the same structure qbm/circuits/builder.py::pauli_rotation already uses for circuits).
Acceptance
- a 3-body generator agrees with the dense backend to the usual TN tolerance (~1e-6)
- existing bond-dimension scaling is not degraded for 1-/2-body models
Getting oriented
Week 14 of the codebase tour.
qbm/backends/tensor_network.py::_decomposeraises for any generator acting on more than two sites:That is a real restriction rather than a fundamental one — it exists because the Trotter gates are built as explicit 1- or 2-site matrices. Models built with
pauli_pool(n, locality=3), or any 3-body coupling, simply cannot use this backend.What to do
Either apply a k-site gate as an MPO, or decompose the k-body Pauli rotation into a CNOT-ladder of 2-site gates (the same structure
qbm/circuits/builder.py::pauli_rotationalready uses for circuits).Acceptance
Getting oriented
Week 14 of the codebase tour.