Tensor computing application programming interface: An application-oriented, lightweight API for portable high-performance tensor network computations
Organizations: Department of Physics and Astronomy, California State University Northridge, Northridge, California 91330, USA · RIKEN Interdisciplinary Theoretical and Mathematical Sciences Program (iTHEMS), Wako, Saitama 351-0198, Japan · Computational Materials Science Research Team, RIKEN Center for Computational Science (R-CCS), Kobe, Hyogo, 650-0047, Japan · Quantum Computational Science Research Team, RIKEN Center for Quantum Computing (RQC), Wako, Saitama, 351-0198, Japan ·
Abstract
Tensor networks (TNs) are a central computational tool in quantum science and artificial intelligence. However, the lack of a unified software interface across tensor-computing frameworks severely limits the portability of TN applications, coupling algorithmic development to specific hardware and software back ends. To address this challenge, we introduce the Tensor Computing Application Programming Interface (TCAPI)---an application-oriented, lightweight API designed to enable framework-independent, high-performance TN applications, currently specified for C++ and Python. TCAPI provides well-defined type-system conventions that abstract tensor objects, together with a minimal yet expressive set of core functions for essential tensor manipulations and tensor linear-algebra operations, with operation semantics shared across language specifications. Through numerical demonstrations of representative tensor-network applications implemented in C++ using TCAPI, we show that code written against TCAPI can be migrated seamlessly across heterogeneous hardware and software platforms while achieving performance comparable to native framework implementations. We further provide open-source implementations of TCAPI based on Cytnx and ITensor in C++, and on NumPy in Python, demonstrating its practicality and ease of integration with existing tensor-computing frameworks.
Figures & tables
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Member type | Description |
|---|---|
| ten_t | Concrete tensor type corresponding to TenT . |
| order_t | Integral type for the tensor order. |
| shape_t | Shape type in bond-index order; List<bond_dim_t> . |
| bond_dim_t | Integral type for a bond dimension. |
| bond_idx_t | Integral type for a bond index (zero-based). |
| bond_label_t | Integral type for a user-defined bond label. |
| Auxiliary type | Description |
|---|---|
| List<T> | Sequence container of values of type T ; alias of std::vector<T> . |
| CRef<T> | Non-owning const reference to an object of type T ; alias of std::reference_wrapper<const T> . |
| Pair<T, U> | Pair of values of types T and U ; alias of std::pair<T,U> . |
| Map<T, U> | Associative container mapping T U ; alias of std::unordered_map<T,U> . |
| Metadata | Description |
|---|---|
| ten_type | Raw backend tensor class returned by TCAPI functions. |
| dtype | Backend-native dtype of elements; Python analogue of tcapi::elem_t<TenT> . |
| real_dtype | Backend-native real dtype; Python analogue of tcapi::real_t<TenT> . |
| cplx_dtype | Backend-native complex dtype; Python analogue of tcapi::cplx_t<TenT> . |
| real_ten_kind | Tensor kind corresponding to tcapi::real_ten_t<TenT> . |
| cplx_ten_kind | Tensor kind corresponding to tcapi::cplx_ten_t<TenT> . |
Tensor Networks
Tensor networks represent high-dimensional data and quantum states as interconnected low-rank tensors to enable efficient computation, learning, and simulation.
See all 50 papers