tensordot

tenpy.linalg.np_conserved.tensordot(a, b, axes=2)[source]

Similar as np.tensordot but for Array.

Builds the tensor product of a and b and sums over the specified axes. Does not require complete blocking of the charges.

Labels are inherited from a and b. In case of a collision (= the same label would be inherited from a and b after the contraction), both labels are dropped.

Detailed implementation notes are available in the doc-string of _tensordot_worker().

Parameters:
  • a (Array) – The first and second npc Array for which axes are to be contracted.

  • b (Array) – The first and second npc Array for which axes are to be contracted.

  • axes ((axes_a, axes_b) | int) – A single integer is equivalent to (range(-axes, 0), range(axes)). Alternatively, axes_a and axes_b specify the legs of a and b, respectively, which should be contracted. Legs can be specified with leg labels or indices. Contract leg axes_a[i] of a with leg axes_b[i] of b.

Returns:

a_dot_b – The tensorproduct of a and b, summed over the specified axes. Returns a scalar in case of a full contraction.

Return type:

Array