Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

arXiv:1906.06329

TensorNetwork for Machine Learning

Stavros Efthymiou, Jack D. Hidary, Stefan Leichenauer

Published Jun 7, 2019• 58 citations
arXivHTMLPDF

Abstract

We demonstrate the use of tensor networks for image classification with the TensorNetwork open source library. We explain in detail the encoding of image data into a matrix product state form, and describe how to contract the network in a way that is parallelizable and well-suited to automatic gradients for optimization. Applying the technique to the MNIST and Fashion-MNIST datasets we find out-of-the-box performance of 98% and 88% accuracy, respectively, using the same tensor network architecture. The TensorNetwork library allows us to seamlessly move from CPU to GPU hardware, and we see a factor of more than 10 improvement in computational speed using a GPU.

DOI
10.48550/arxiv.1906.06329

Related papers

TensorNetwork: A Library for Physics and Machine Learning

Chase Roberts, Ashley Milsted, Martin Ganahl +6 more

TensorNetwork is an open source library for implementing tensor network algorithms. Tensor networks are sparse data structures originally designed for simulating quantum many-body physics, but are currently also applied in a number of other research areas, including machine learning. We demonstrate the use of the API with applications both physics and machine learning, with details appearing in companion papers.

arXiv:1905.01330•May 3, 2019•66 citations

TensorNetwork on TensorFlow: A Spin Chain Application Using Tree Tensor Networks

Ashley Milsted, Martin Ganahl, Stefan Leichenauer +2 more

TensorNetwork is an open source library for implementing tensor network algorithms in TensorFlow. We describe a tree tensor network (TTN) algorithm for approximating the ground state of either a periodic quantum spin chain (1D) or a lattice model on a thin torus (2D), and implement the algorithm using TensorNetwork. We use a standard energy minimization procedure over a TTN ansatz with bond dimension $χ$, with a computational cost that scales as $O(χ^4)$. Using bond dimension $χ\in [32,256]$ we compare the use of CPUs with GPUs and observe significant computational speed-ups, up to a factor of $100$, using a GPU and the TensorNetwork library.

arXiv:1905.01331•May 3, 2019•11 citations

Improving Image Classification with Quantum Neural Network

A S Reejisha, Anuraj Mohan

Image classification is a fundamental task in computer vision that involves assigning labels to images based on their content. In recent years, deep learning techniques based on classical neural networks (CNN) have achieved modern performance on many image classification tasks. However, there is growing interest in using quantum neural networks (QNNs) for image classification, as quantum computing has the potential to improve the accuracy and speed of computation. We demonstrate the potential of our QNN model and QCNN model by applying it to the fashion MNIST dataset. The results indicate that the QNN model exhibits faster training speed and higher testing set accuracy compared to a QCNN with a similar architecture.

International Conference on Computer, Electronics & Electrical Engineering & their Applications (IC2E3)•Jun 8, 2023•5 citations

Entanglement and Tensor Networks for Supervised Image Classification

John M. Martyn, Guifré Vidal, Chase Roberts +1 more

Tensor networks, originally designed to address computational problems in quantum many-body physics, have recently been applied to machine learning tasks. However, compared to quantum physics, where the reasons for the success of tensor network approaches over the last 30 years is well understood, very little is yet known about why these techniques work for machine learning. The goal of this paper is to investigate entanglement properties of tensor network models in a current machine learning application, in order to uncover general principles that may guide future developments. We revisit the use of tensor networks for supervised image classification using the MNIST data set of handwritten digits, as pioneered by Stoudenmire and Schwab [Adv. in Neur. Inform. Proc. Sys. 29, 4799 (2016)]. Firstly we hypothesize about which state the tensor network might be learning during training. For that purpose, we propose a plausible candidate state $|Σ_{\ell}\rangle$ (built as a superposition of product states corresponding to images in the training set) and investigate its entanglement properties. We conclude that $|Σ_{\ell}\rangle$ is so robustly entangled that it cannot be approximated by the tensor network used in that work, which must therefore be representing a very different state. Secondly, we use tensor networks with a block product structure, in which entanglement is restricted within small blocks of $n \times n$ pixels/qubits. We find that these states are extremely expressive (e.g. training accuracy of $99.97 \%$ already for $n=2$), suggesting that long-range entanglement may not be essential for image classification. However, in our current implementation, optimization leads to over-fitting, resulting in test accuracies that are not competitive with other current approaches.

arXiv:2007.06082•Jul 12, 2020•23 citations

tn4ml: Tensor Network Training and Customization for Machine Learning

Ema Puljak, Sergio Sanchez, Sergi Masot-Llima +3 more

Tensor Networks have emerged as a prominent alternative to neural networks for addressing Machine Learning challenges in foundational sciences, paving the way for their applications to real-life problems. This paper introduces tn4ml, a novel library designed to seamlessly integrate Tensor Networks into optimization pipelines for Machine Learning tasks. Inspired by existing Machine Learning frameworks, the library offers a user-friendly structure with modules for data embedding, objective function definition, and model training using diverse optimization strategies. We demonstrate its versatility through two examples: supervised learning on tabular data and unsupervised learning on an image dataset. Additionally, we analyze how customizing the parts of the Machine Learning pipeline for Tensor Networks influences performance metrics.

arXiv:2502.13090•Feb 18, 2025•0 citations

Deterministic Tensor Network Classifiers

L. Wright, Fergus Barratt, James Dborin +3 more

We present tensor networks for feature extraction and refinement of classifier performance. These networks can be initialised deterministically and have the potential for implementation on near-term intermediate-scale quantum (NISQ) devices. Feature extraction proceeds through a direct combination and compression of images amplitude-encoded over just $\log N_{\text{pixels}}$ qubits. Performance is refined using `Quantum Stacking', a deterministic method that can be applied to the predictions of any classifier regardless of structure, and implemented on NISQ devices using data re-uploading. These procedures are applied to a tensor network encoding of data, and benchmarked against the 10 class MNIST and fashion MNIST datasets. Good training and test accuracy are achieved without any variational training.

arXiv:2205.09768•May 19, 2022•0 citations
We demonstrate the use of tensor networks for image classification with the TensorNetwork open source library. We explain in detail the encoding of image data into a matrix product state form, and describe how to contract the network in a way that is parallelizable and well-suited to automatic gradients for optimization. Applying the technique to the MNIST and Fashion-MNIST datasets we find out-of-the-box performance of 98% and 88% accuracy, respectively, using the same tensor network architecture. The TensorNetwork library allows us to seamlessly move from CPU to GPU hardware, and we see a factor of more than 10 improvement in computational speed using a GPU.
TensorNetwork is an open source library for implementing tensor network algorithms in TensorFlow. We describe a tree tensor network (TTN) algorithm for approximating the ground state of either a periodic quantum spin chain (1D) or a lattice model on a thin torus (2D), and implement the algorithm using TensorNetwork. We use a standard energy minimization procedure over a TTN ansatz with bond dimension χχχ, with a computational cost that scales as O(χ4)O(χ^4)O(χ4). Using bond dimension χ∈[32,256]χ\in [32,256]χ∈[32,256] we compare the use of CPUs with GPUs and observe significant computational speed-ups, up to a factor of 100100100, using a GPU and the TensorNetwork library.
Image classification is a fundamental task in computer vision that involves assigning labels to images based on their content. In recent years, deep learning techniques based on classical neural networks (CNN) have achieved modern performance on many image classification tasks. However, there is growing interest in using quantum neural networks (QNNs) for image classification, as quantum computing has the potential to improve the accuracy and speed of computation. We demonstrate the potential of our QNN model and QCNN model by applying it to the fashion MNIST dataset. The results indicate that the QNN model exhibits faster training speed and higher testing set accuracy compared to a QCNN with a similar architecture.
Tensor networks, originally designed to address computational problems in quantum many-body physics, have recently been applied to machine learning tasks. However, compared to quantum physics, where the reasons for the success of tensor network approaches over the last 30 years is well understood, very little is yet known about why these techniques work for machine learning. The goal of this paper is to investigate entanglement properties of tensor network models in a current machine learning application, in order to uncover general principles that may guide future developments. We revisit the use of tensor networks for supervised image classification using the MNIST data set of handwritten digits, as pioneered by Stoudenmire and Schwab [Adv. in Neur. Inform. Proc. Sys. 29, 4799 (2016)]. Firstly we hypothesize about which state the tensor network might be learning during training. For that purpose, we propose a plausible candidate state ∣Σℓ⟩|Σ_{\ell}\rangle∣Σℓ​⟩ (built as a superposition of product states corresponding to images in the training set) and investigate its entanglement properties. We conclude that ∣Σℓ⟩|Σ_{\ell}\rangle∣Σℓ​⟩ is so robustly entangled that it cannot be approximated by the tensor network used in that work, which must therefore be representing a very different state. Secondly, we use tensor networks with a block product structure, in which entanglement is restricted within small blocks of n×nn \times nn×n pixels/qubits. We find that these states are extremely expressive (e.g. training accuracy of 99.97%99.97 \%99.97% already for n=2n=2n=2), suggesting that long-range entanglement may not be essential for image classification. However, in our current implementation, optimization leads to over-fitting, resulting in test accuracies that are not competitive with other current approaches.
Tensor Networks have emerged as a prominent alternative to neural networks for addressing Machine Learning challenges in foundational sciences, paving the way for their applications to real-life problems. This paper introduces tn4ml, a novel library designed to seamlessly integrate Tensor Networks into optimization pipelines for Machine Learning tasks. Inspired by existing Machine Learning frameworks, the library offers a user-friendly structure with modules for data embedding, objective function definition, and model training using diverse optimization strategies. We demonstrate its versatility through two examples: supervised learning on tabular data and unsupervised learning on an image dataset. Additionally, we analyze how customizing the parts of the Machine Learning pipeline for Tensor Networks influences performance metrics.
We present tensor networks for feature extraction and refinement of classifier performance. These networks can be initialised deterministically and have the potential for implementation on near-term intermediate-scale quantum (NISQ) devices. Feature extraction proceeds through a direct combination and compression of images amplitude-encoded over just log⁡Npixels\log N_{\text{pixels}}logNpixels​ qubits. Performance is refined using `Quantum Stacking', a deterministic method that can be applied to the predictions of any classifier regardless of structure, and implemented on NISQ devices using data re-uploading. These procedures are applied to a tensor network encoding of data, and benchmarked against the 10 class MNIST and fashion MNIST datasets. Good training and test accuracy are achieved without any variational training.