NLA-lib Explorer

NLAlib.relativeEntropy_eq

Library 路 theorem

The relative entropy expanded into four traces: D(\mathbf{A}; \mathbf{H}) = \operatorname{tr}(\mathbf{A}\log(\mathbf{A})) - \operatorname{tr}(\mathbf{A}\log(\mathbf{H})) - \operatorname{tr} \mathbf{A} + \operatorname{tr} \mathbf{H} \,, each trace through its real part.

NLAlib.relativeEntropy_eq.{u_1, u_2} {饾暅 : Type u_1} [RCLike 饾暅] {n : Type u_2} [Fintype n]
  [DecidableEq n] (A H : Matrix n n 饾暅) :
  relativeEntropy A H =
    RCLike.re (A * cfc Real.log A).trace - RCLike.re (A * cfc Real.log H).trace -
        RCLike.re A.trace +
      RCLike.re H.trace

Full source on GitHub

Import NLAlib.Matrix.Functions.Lieb.