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

Contract all legs in a and b, return scalar.

  • b (a,) – 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 specifiy 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. The default axes='range' is equivalent to (range(rank), range(rank)). 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)


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

Return type