inner

tenpy.linalg.np_conserved.inner(a, b, axes='labels', do_conj=False)[source]

Contract all legs in a and b, return scalar.

Changed in version 1.0: Change default behaviour of axes from 'range' to 'labels'.

Parameters:
  • a (class:Array) – The arrays for which to calculate the product. Must have same rank, and compatible LegCharges.

  • b (class:Array) – The arrays for which to calculate the product. Must have same rank, and compatible LegCharges.

  • axes ((axes_a, axes_b) | 'range', 'labels') – 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. We contract leg axes_a[i] of a with leg axes_b[i] of b. axes='range' is equivalent to (range(rank), range(rank)). The default axes='labels' is equivalent to either (a.get_leg_labels(), a.get_leg_labels()) for do_conj=True, or to (a.get_leg_labels(), conj_labels(a.get_leg_labels())) for do_conj=False. In other words, axes='labels' requires a and b to have the same/conjugated labels up to a possible transposition, which is then reverted.

  • do_conj (bool) – If False (Default), ignore it. If True, conjugate a before, i.e., return inner(a.conj(), b, axes).

Returns:

inner_product – A scalar (of common dtype of a and b) giving the full contraction of a and b.

Return type:

dtype