npc.zeros and labels
Posted: 15 May 2020, 10:59
Hi! I am now learning how to use the Tenpy library and I am now following the example code.
At the first a_np_conserved.py code, I tried to execute it, but it showed an error.
The error was at
B_even = npc.zeros([v_leg_even, v_leg_odd.conj(), p_leg], label=['vL', 'vR', 'p']) # virtual left/right, physical
TypeError: zeros() got an unexpected keyword argument 'label'
I checked the source code of 'zeros()', and this function does not have the argument 'label'
[docs]def zeros(legcharges, dtype=np.float64, qtotal=None):
"""Create a npc array full of zeros (with no _data).
This is just a wrapper around ``Array(...)``, detailed documentation can be found in the class
doc-string of :class:`Array`.
"""
return Array(legcharges, dtype, qtotal)
Was the example code outdated?
How can I label the index for zeros?
Thanks in advance.
At the first a_np_conserved.py code, I tried to execute it, but it showed an error.
The error was at
B_even = npc.zeros([v_leg_even, v_leg_odd.conj(), p_leg], label=['vL', 'vR', 'p']) # virtual left/right, physical
TypeError: zeros() got an unexpected keyword argument 'label'
I checked the source code of 'zeros()', and this function does not have the argument 'label'
[docs]def zeros(legcharges, dtype=np.float64, qtotal=None):
"""Create a npc array full of zeros (with no _data).
This is just a wrapper around ``Array(...)``, detailed documentation can be found in the class
doc-string of :class:`Array`.
"""
return Array(legcharges, dtype, qtotal)
Was the example code outdated?
How can I label the index for zeros?
Thanks in advance.