jcmgray / cotengra

Hyper optimized contraction trees for large tensor networks and einsums
https://cotengra.readthedocs.io
Apache License 2.0
174 stars 32 forks source link

'str' object has no attribute 'difference', when running Quantum Circuit Example.ipynb #20

Closed zadnarock closed 1 year ago

zadnarock commented 1 year ago

What is your issue?

Apart from exactly running the contents of the ipynb file, I have run the following lines of code:

!pip install -U git+https://github.com/jcmgray/cotengra.git

!pip install -r requirements.txt

requirements.txt involves : numpy scipy numba cytoolz tqdm psutil opt_einsum autoray matplotlib networkx slepc4py slepc petsc4py petsc mpi4py

!pip install quimb pip install python-igraph pip install kahypar

I encountered the above error on the following line : info = tn.contract(all, optimize=opt, get='path-info') which linked to G.add_vertex(str(i), inds=term.difference(output), weight=nweight) in path_igraph.py. Could you please help me resolve it?

jcmgray commented 1 year ago

This should be fixed by https://github.com/jcmgray/cotengra/commit/4a7b97bd88e66f0b08ba05fb3f6d64bc1982045b, thanks for the report.