grid_insert_ops
full name: tenpy.networks.mpo.grid_insert_ops
parent module:
tenpy.networks.mpotype: function
- tenpy.networks.mpo.grid_insert_ops(site, grid)[source]
Replaces entries representing operators in a grid of
W[i]with npc.Arrays.- Parameters:
site (
site) – The site on which the grid acts.grid (list of list of entries) – Represents a single matrix W of an MPO, i.e. the lists correspond to the legs
'vL', 'vR', and entries to onsite operators acting on the given site. entries may beNone,Array, a single string or of the form[('opname', strength), ...], where'opname'labels an operator in the site.
- Returns:
grid – Copy of grid with entries
[('opname', strength), ...]replaced bysum([strength*site.get_op('opname') for opname, strength in entry])and entries'opname'replaced bysite.get_op('opname').- Return type:
list of list of {None |
Array}