Closed bsiegelwax closed 8 months ago
Hi! Thanks for opening the issue. The Basic Usage sample code is working on my end. How are you installing TQ? I think the issues should be resolved if you install from source:
!git clone https://github.com/mit-han-lab/torchquantum.git
!cd torchquantum && pip install --editable .
Let me know if this works and if you have any further questions! I’ll also see about getting the pip version updated.
I'm trying it in Google Colab. I have a blanket policy against installing anything locally.
To clarify, you should be able to copy and paste the snippet from my previous comment into a Colab cell to make the Basic Usage code work in Colab.
That changed the error to:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
[<ipython-input-27-9273634550b9>](https://localhost:8080/#) in <cell line: 2>()
1 import torchquantum as tq
----> 2 import torchquantum.functional as tqf
3
4 qdev = tq.QuantumDevice(n_wires=2, bsz=5, device="cpu", record_op=True) # use device='cuda' for GPU
5
ModuleNotFoundError: No module named 'torchquantum.functional'
Try this Colab notebook: https://colab.research.google.com/drive/17E-QMAW0cAjI4HGiAQ7mS5wloqbjmwJF?usp=sharing
My guess is maybe the error is related to the old TQ still being installed. The above Colab worked just fine for me, but let me know if there are any errors on your side!
Marking as resolved for now but please let me know if you have any more questions!
ModuleNotFoundError Traceback (most recent call last)
ModuleNotFoundError: No module named 'torchquantum.functional'
I have the error also, and I didn't manage to solve it
Also I tried the colab notebook u post
Running the "Basic Usage" example results in:
in Google Colab.