-
Notifications
You must be signed in to change notification settings - Fork 127
Open
Description
What is your issue?
I'm trying to use DMRG to initialize a quantum circuit with ancillas. I am trying to prepare a state
Quimb uses the 'lpr' shape convention for the DMRG output indices, but everywhere else it seems to use the 'lrp' convention. Besides, calling quimb.tensor.MPS_computational_state with the option shape='lpr' produces a TypeError:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[271], line 1
----> 1 zero_mps = qtn.MPS_computational_state('0'*m_L, shape='lpr')
File ~/*****/lib/python3.12/site-packages/quimb/tensor/tensor_builder.py:3802, in MPS_computational_state(binary, dtype, cyclic, **mps_opts)
3799 for s in binary:
3800 yield array_map[str(s)]
-> 3802 return MPS_product_state(tuple(gen_arrays()), cyclic=cyclic, **mps_opts)
File ~/*****/lib/python3.12/site-packages/quimb/tensor/tensor_builder.py:3772, in MPS_product_state(arrays, cyclic, **mps_opts)
3765 yield (*cyc_dim, 1, -1)
3767 mps_arrays = (
3768 asarray(array).reshape(*shape)
3769 for array, shape in zip(arrays, gen_array_shapes())
3770 )
-> 3772 return MatrixProductState(mps_arrays, shape="lrp", **mps_opts)
TypeError: quimb.tensor.tensor_1d.MatrixProductState() got multiple values for keyword argument 'shape'
It would be nice either to have a way to change the shape convention of the DMRG.state MPS, or to unify conventions by default. Thanks!
Metadata
Metadata
Assignees
Labels
No labels