PennyLaneAI / pennylane

PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network.
https://pennylane.ai
Apache License 2.0
2.28k stars 585 forks source link

[unitaryhack] Create a quantum simulator in PyTorch #1225

Closed co9olguy closed 3 years ago

co9olguy commented 3 years ago

This issue has been tagged for a $100 bounty during unitaryHACK

PennyLane can currently perform quantum simulation (in a backprop-compatible way) using autograd, jax, and tensorflow. The notable exception is PyTorch. This has been hampered in the past by the fact that PyTorch did not support matrix multiplication or gradients for computaitons involving complex-valued tensors.

With the release of PyTorch v1.8, it should now be possible to build a default.qubit.torch alongside default.qubit.autograd, default.qubit.tf, and default.qubit.jax.

Thiis long-requested feature has been tackled before in #929, but that effort seems to have languished.

anushkrishnav commented 3 years ago

I would love to work on this. Can you please share some guide or sample for me too look into and prep

co9olguy commented 3 years ago

Hi @anushkrishnav, Awesome that you want to work on this :tada:

Just a reminder that we've tagged it for unitaryHACK, which is running May 14-30th, so if you time your solution to come in during that period, and your PR is accepted, you can snag a bounty (and some street cred :sunglasses:)

If you want to prepare, the best places to start are:

Slimane33 commented 3 years ago

Hello, I am also interested to work on that. I was just wondering what was the general interest of building other default.qubit objects based on tf, jax or torch ? Is it to enable GPU running ?

josh146 commented 3 years ago

Hi @Slimane33, yes! In particular, having a device written using TensorFlow/JAX/Torch has several advantages, since the entire computation is end-to-end written natively using the aforementioned framework.

As a result,

antalszava commented 3 years ago

With #1360 merged, closing this.