inner
full name: tenpy.linalg.np_conserved.inner
parent module:
tenpy.linalg.np_conservedtype: function
- 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 legaxes_a[i]of a with legaxes_b[i]of b.axes='range'is equivalent to(range(rank), range(rank)). The defaultaxes='labels'is equivalent to either(a.get_leg_labels(), a.get_leg_labels())fordo_conj=True, or to(a.get_leg_labels(), conj_labels(a.get_leg_labels()))fordo_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. IfTrue, conjugate a before, i.e., returninner(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: