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
TLoL (Python Module) - League of Legends Deep Learning AI (Research and Development)

TLoL-py - League of Legends Deep Learning Library TLoL-py is the Python component of the TLoL League of Legends deep learning library. It provides a s

7 Nov 29, 2022
Fast RFC3339 compliant Python date-time library

udatetime: Fast RFC3339 compliant date-time library Handling date-times is a painful act because of the sheer endless amount of formats used by people

Simon Pirschel 235 Oct 25, 2022
An Abstract Cyber Security Simulation and Markov Game for OpenAI Gym

gym-idsgame An Abstract Cyber Security Simulation and Markov Game for OpenAI Gym gym-idsgame is a reinforcement learning environment for simulating at

Kim Hammar 29 Dec 03, 2022
Unrolled Generative Adversarial Networks

Unrolled Generative Adversarial Networks Luke Metz, Ben Poole, David Pfau, Jascha Sohl-Dickstein arxiv:1611.02163 This repo contains an example notebo

Ben Poole 292 Dec 06, 2022
DeepAL: Deep Active Learning in Python

DeepAL: Deep Active Learning in Python Python implementations of the following active learning algorithms: Random Sampling Least Confidence [1] Margin

Kuan-Hao Huang 583 Jan 03, 2023
Run containerized, rootless applications with podman

Why? restrict scope of file system access run any application without root privileges creates usable "Desktop applications" to integrate into your nor

119 Dec 27, 2022
Code and Data for NeurIPS2021 Paper "A Dataset for Answering Time-Sensitive Questions"

Time-Sensitive-QA The repo contains the dataset and code for NeurIPS2021 (dataset track) paper Time-Sensitive Question Answering dataset. The dataset

wenhu chen 35 Nov 14, 2022
Official implementation of the paper WAV2CLIP: LEARNING ROBUST AUDIO REPRESENTATIONS FROM CLIP

Wav2CLIP 🚧 WIP 🚧 Official implementation of the paper WAV2CLIP: LEARNING ROBUST AUDIO REPRESENTATIONS FROM CLIP 📄 🔗 Ho-Hsiang Wu, Prem Seetharaman

Descript 240 Dec 13, 2022
The 7th edition of NTIRE: New Trends in Image Restoration and Enhancement workshop will be held on June 2022 in conjunction with CVPR 2022.

NTIRE 2022 - Image Inpainting Challenge Important dates 2022.02.01: Release of train data (input and output images) and validation data (only input) 2

Andrés Romero 37 Nov 27, 2022
Leaf: Multiple-Choice Question Generation

Leaf: Multiple-Choice Question Generation Easy to use and understand multiple-choice question generation algorithm using T5 Transformers. The applicat

Kristiyan Vachev 62 Dec 20, 2022
Exploit ILP to learn symmetry breaking constraints of ASP programs.

ILP Symmetry Breaking Overview This project aims to exploit inductive logic programming to lift symmetry breaking constraints of ASP programs. Given a

Research Group Production Systems 1 Apr 13, 2022
Part-Aware Data Augmentation for 3D Object Detection in Point Cloud

Part-Aware Data Augmentation for 3D Object Detection in Point Cloud This repository contains a reference implementation of our Part-Aware Data Augment

Jaeseok Choi 62 Jan 03, 2023
Code for "Unsupervised Layered Image Decomposition into Object Prototypes" paper

DTI-Sprites Pytorch implementation of "Unsupervised Layered Image Decomposition into Object Prototypes" paper Check out our paper and webpage for deta

40 Dec 22, 2022
The UI as a mobile display for OP25

OP25 Mobile Control Head A 'remote' control head that interfaces with an OP25 instance. We take advantage of some data end-points left exposed for the

Sarah Rose Giddings 13 Dec 28, 2022
Source code and data in paper "MDFEND: Multi-domain Fake News Detection (CIKM'21)"

MDFEND: Multi-domain Fake News Detection This is an official implementation for MDFEND: Multi-domain Fake News Detection which has been accepted by CI

Rich 40 Dec 18, 2022
MoveNet Single Pose on DepthAI

MoveNet Single Pose tracking on DepthAI Running Google MoveNet Single Pose models on DepthAI hardware (OAK-1, OAK-D,...). A convolutional neural netwo

64 Dec 29, 2022
repro_eval is a collection of measures to evaluate the reproducibility/replicability of system-oriented IR experiments

repro_eval repro_eval is a collection of measures to evaluate the reproducibility/replicability of system-oriented IR experiments. The measures were d

IR Group at Technische Hochschule Köln 9 May 25, 2022
Fast algorithms to compute an approximation of the minimal volume oriented bounding box of a point cloud in 3D.

ApproxMVBB Status Build UnitTests Homepage Fast algorithms to compute an approximation of the minimal volume oriented bounding box of a point cloud in

Gabriel Nützi 390 Dec 31, 2022
A working implementation of the Categorical DQN (Distributional RL).

Categorical DQN. Implementation of the Categorical DQN as described in A distributional Perspective on Reinforcement Learning. Thanks to @tudor-berari

Florin Gogianu 98 Sep 20, 2022
Image Recognition using Pytorch

PyTorch Project Template A simple and well designed structure is essential for any Deep Learning project, so after a lot practice and contributing in

Sarat Chinni 1 Nov 02, 2021