grid_insert_ops

  • full name: tenpy.networks.mpo.grid_insert_ops

  • parent module: tenpy.networks.mpo

  • type: 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 be None, 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 by sum([strength*site.get_op('opname') for opname, strength in entry]) and entries 'opname' replaced by site.get_op('opname').

Return type:

list of list of {None | Array}