Tensor-Based Quantum Machine Learning

Overview
https://codecov.io/gh/tensorly/quantum/branch/main/graph/badge.svg?token=5P8GZ8YLO7

TensorLy_Quantum

TensorLy-Quantum is a Python library for Tensor-Based Quantum Machine Learning that builds on top of TensorLy and PyTorch.

With TensorLy-Quantum, you can easily:

  • Create large quantum circuit: Tensor network formalism requires up to exponentially less memory for quantum simulation than traditional vector and matrix approaches.
  • Leverage tensor methods: the state vectors are efficiently represented in factorized form as Tensor-Rings (MPS) and the operators as TT-Matrices (MPO)
  • Efficient simulation: tensorly-quantum leverages the factorized structure to efficiently perform quantum simulation without ever forming the full, dense operators and state-vectors
  • Multi-Basis Encoding: we provide multi-basis encoding out-of-the-box for scalable experimentation
  • Solve hard problems: we provide all the tools to solve the MaxCut problem for an unprecendented number of qubits / vertices

Installing TensorLy-Quantum

Through pip

pip install tensorly-quantum

From source

git clone https://github.com/tensorly/quantum
cd quantum
pip install -e .
Comments
  • Rz has no gradient issue resolved

    Rz has no gradient issue resolved

    Hey there, The way RotZ was implemented it didn't have any gradient. I fixed the issue by using the same template as for the RotY and RotX. I think the tl.tensor() in the original version somehow blocked the backprop. The way it is written now the gradient is correct.

    opened by PatrickHuembeli 3
  • calculate_cut in the VQE example?

    calculate_cut in the VQE example?

    Hello! I have been trying to use your code to compute the MaxCut in the VQE jupyter notebook provided in the example sections. I tried to apply the calculate_cut function on the state as tlq.calculate_cut(state, qubits1, qubits2, weights) but I am having the following error TypeError: only integer tensors of a single element can be converted to an index.

    I see that the cut is calculated differently in the MBE example, but I would like to know if there is an analogue way of doing it with the VQE. Or should I just adapt my Hamiltonian to maximize the cut? Any help is appreciated, Thanks!

    opened by marionsilv 2
  • How to use cuQuantum as a backend

    How to use cuQuantum as a backend

    Hi,

    Thank you for your great work! May I know how to use cuQuantum as a backend as mentioned in your paper? Could you please provide a code example? How does the cuQuantum backend support autograd? Thank you very much!

    opened by nadbp 1
  • CNOT gate issue

    CNOT gate issue

    Hello,

    I have been trying to build a circuit with a CNOT gate acting on non-contiguous qubits (e.g., qubit 1 and 4), but I am finding strange results.

    For example, if I choose an initial state [1,0,0,0]

    and apply the unitary uni = tlq.Unitary([tlq.CNOTL(device=device, dtype=dtype), tlq.CNOTR(device=device, dtype=dtype), tlq.IDENTITY(dtype=dtype, device=device), tlq.IDENTITY(dtype=dtype, device=device)], nqubits, ncontraq, device=device, dtype=dtype)

    I get (for the expected value of Sz): tensor([-1., -1., 1., 1.])

    However, if I apply the CNOT cores to non-adjacent qubits in the same initial state, with uni = tlq.Unitary([tlq.CNOTL(device=device, dtype=dtype), tlq.IDENTITY(dtype=dtype, device=device), tlq.IDENTITY(dtype=dtype, device=device), tlq.CNOTR(device=device, dtype=dtype)], nqubits, ncontraq, device=device, dtype=dtype)

    I find, again for the expected value of Sz: tensor([-2., 2., 2., 0.])

    Is there any limitation regarding the CNOT cores that make it only valid for adjacent qubits, or am I doing something wrong? I am attaching a file with the full code for running: code.txt

    Thanks for the help, Marion Silvestrini.

    opened by marionsilv 2
  • Hamiltonian unitary

    Hamiltonian unitary

    Hello all,

    I was wondering if there is a way in TensorLy Quantum to build a parametrised unitary based on a binary Hamiltonian, such as the Ising model given in the examples, for use in the circuits.

    I mean to use it in an application like a QAOA, for instance. Is there a way to adapt from the binary_hamiltonian function, or something like that?

    Thanks!

    opened by rafaeleb 10
Releases(0.1.0)
Owner
TensorLy
Tensor Learning in Python.
TensorLy
Yolov5+SlowFast: Realtime Action Detection Based on PytorchVideo

Yolov5+SlowFast: Realtime Action Detection A realtime action detection frame work based on PytorchVideo. Here are some details about our modification:

WuFan 181 Dec 30, 2022
Certifiable Outlier-Robust Geometric Perception

Certifiable Outlier-Robust Geometric Perception About This repository holds the implementation for certifiably solving outlier-robust geometric percep

83 Dec 31, 2022
PyTorch implementation of paper “Unbiased Scene Graph Generation from Biased Training”

A new codebase for popular Scene Graph Generation methods (2020). Visualization & Scene Graph Extraction on custom images/datasets are provided. It's also a PyTorch implementation of paper “Unbiased

Kaihua Tang 824 Jan 03, 2023
Selfplay In MultiPlayer Environments

This project allows you to train AI agents on custom-built multiplayer environments, through self-play reinforcement learning.

200 Jan 08, 2023
🌈 PyTorch Implementation for EMNLP'21 Findings "Reasoning Visual Dialog with Sparse Graph Learning and Knowledge Transfer"

SGLKT-VisDial Pytorch Implementation for the paper: Reasoning Visual Dialog with Sparse Graph Learning and Knowledge Transfer Gi-Cheon Kang, Junseok P

Gi-Cheon Kang 9 Jul 05, 2022
Official implementation of paper "Query2Label: A Simple Transformer Way to Multi-Label Classification".

Introdunction This is the official implementation of the paper "Query2Label: A Simple Transformer Way to Multi-Label Classification". Abstract This pa

Shilong Liu 274 Dec 28, 2022
A vision library for performing sliced inference on large images/small objects

SAHI: Slicing Aided Hyper Inference A vision library for performing sliced inference on large images/small objects Overview Object detection and insta

Open Business Software Solutions 2.3k Jan 04, 2023
RSNA Intracranial Hemorrhage Detection with python

RSNA Intracranial Hemorrhage Detection This is the source code for the first place solution to the RSNA2019 Intracranial Hemorrhage Detection Challeng

24 Nov 30, 2022
Dynamic View Synthesis from Dynamic Monocular Video

Towards Robust Monocular Depth Estimation: Mixing Datasets for Zero-shot Cross-dataset Transfer This repository contains code to compute depth from a

Intelligent Systems Lab Org 2.3k Jan 01, 2023
Beginner-friendly repository for Hacktober Fest 2021. Start your contribution to open source through baby steps. 💜

Hacktober Fest 2021 🎉 Open source is changing the world – one contribution at a time! 🎉 This repository is made for beginners who are unfamiliar wit

Abhilash M Nair 32 Dec 11, 2022
Use unsupervised and supervised learning to predict stocks

AIAlpha: Multilayer neural network architecture for stock return prediction This project is meant to be an advanced implementation of stacked neural n

Vivek Palaniappan 1.5k Dec 26, 2022
Towards uncontrained hand-object reconstruction from RGB videos

Towards uncontrained hand-object reconstruction from RGB videos Yana Hasson, Gül Varol, Ivan Laptev and Cordelia Schmid Project page Paper Table of Co

Yana 69 Dec 27, 2022
A curated list of programmatic weak supervision papers and resources

A curated list of programmatic weak supervision papers and resources

Jieyu Zhang 118 Jan 02, 2023
DeepOBS: A Deep Learning Optimizer Benchmark Suite

DeepOBS - A Deep Learning Optimizer Benchmark Suite DeepOBS is a benchmarking suite that drastically simplifies, automates and improves the evaluation

Aaron Bahde 7 May 12, 2020
Fast and Context-Aware Framework for Space-Time Video Super-Resolution (VCIP 2021)

Fast and Context-Aware Framework for Space-Time Video Super-Resolution Preparation Dependencies PyTorch 1.2.0 CUDA 10.0 DCNv2 cd model/DCNv2 bash make

Xueheng Zhang 1 Mar 29, 2022
GAN Image Generator and Characterwise Image Recognizer with python

MODEL SUMMARY 모델의 구조는 크게 6단계로 나뉩니다. STEP 0: Input Image Predict 할 이미지를 모델에 입력합니다. STEP 1: Make Black and White Image STEP 1 은 입력받은 이미지의 글자를 흑색으로, 배경을

Juwan HAN 1 Feb 09, 2022
A framework for attentive explainable deep learning on tabular data

🧠 kendrite A framework for attentive explainable deep learning on tabular data 💨 Quick start kedro run 🧱 Built upon Technology Description Links ke

Marnix Koops 3 Nov 06, 2021
When are Iterative GPs Numerically Accurate?

When are Iterative GPs Numerically Accurate? This is a code repository for the paper "When are Iterative GPs Numerically Accurate?" by Wesley Maddox,

Wesley Maddox 1 Jan 06, 2022
This package implements the algorithms introduced in Smucler, Sapienza, and Rotnitzky (2020) to compute optimal adjustment sets in causal graphical models.

optimaladj: A library for computing optimal adjustment sets in causal graphical models This package implements the algorithms introduced in Smucler, S

Facundo Sapienza 6 Aug 04, 2022
History Aware Multimodal Transformer for Vision-and-Language Navigation

History Aware Multimodal Transformer for Vision-and-Language Navigation This repository is the official implementation of History Aware Multimodal Tra

Shizhe Chen 46 Nov 23, 2022