Open stfnmangini opened 1 year ago
Yes this class was a bit of an experimental afterthought that has become outdated. My suggestion would be simply to remove it for the moment. Since it currently doesn't have a real use case for me! but were you hoping to use for something specific?
I see, thank you for the quick reply! As for my use case, my goal was to build an LPDO-like tensor network to represent a CP channel, and with the tweaks above it seems to do the job :D
Do you think it is worth working on it to make it compatible again with the newer versions of quimb
?
What happened?
There is a problem with the
SuperOperator1D
class, as various errors regarding missingsite tags
, missingtag_map
, andoset
concatenations are raised when the class is called (see below).Here is the original definition of the class: https://quimb.readthedocs.io/en/latest/autoapi/quimb/tensor/tensor_1d/index.html#quimb.tensor.tensor_1d.SuperOperator1D
I was able to circumvent the errors with minimal corrections to the original class, even though I am not completely sure that I haven't introduced other mistakes. Here is the updated definition of the class with highlighted changes:
What did you expect to happen?
No errors raised.
Minimal Complete Verifiable Example
Relevant log output
Anything else we need to know?
The same error arises if you specify the tensor data, instead of instantiating a random SuperOperator as in the example above.
Such error
AttributeError: 'SuperOperator1D' object has no attribute '_site_tag_id'
is solved by moving theprocess tags
section in the class right after theprocess indices
section (see updated version of the class above).Then, another error occurs within the function
self.gen_sites_present()
, namelyAttributeError: 'SuperOperator1D' object has no attribute 'tag_map'
. In the modified class above, this is solved with the substitution:Lastly, there is a final error in the function
gen_tags()
, namelyTypeError: can only concatenate tuple (not "oset") to tuple
. This is solved by transforming the tags to tuples, as follows.and similarly for the other tags.
As I said earlier, these small modifications fix the class but I'm not proficient enough with
quimb
to be sure that these do not introduce undesired behaviours.Environment
quimb.__version__ = '1.5.0'
Open to suggestions and comments :)
And kudos to Johnnie for
quimb
, it's truly impressive!