# math¶

Functions

 entropy(p[, n]) Calculate the entropy of a distribution. gcd(a, b) Computes the greatest common divisor (GCD) of two numbers. Return the greatest common divisor of all of entries in a lcm(a, b) Returns the least common multiple (LCM) of two positive numbers. transform an linear operator with a matvec method into a dense numpy array. Given a permutation p of numbers, returns its sign. qr_li(A[, cutoff]) QR decomposition with cutoff to discard nearly linear dependent columns in Q. rq_li(A[, cutoff]) RQ decomposition with cutoff to discard nearly linear dependent columns in Q. speigs(A, k, *args, **kwargs) Wrapper around scipy.sparse.linalg.eigs(), lifting the restriction k < rank(A)-1. speigsh(A, k, *args, **kwargs) Wrapper around scipy.sparse.linalg.eigsh(), lifting the restriction k < rank(A)-1.

Module description

Different math functions needed at some point in the library.

tenpy.tools.math.LeviCivita3 = array([[[ 0, 0, 0], [ 0, 0, 1], [ 0, -1, 0]], [[ 0, 0, -1], [ 0, 0, 0], [ 1, 0, 0]], [[ 0, 1, 0], [-1, 0, 0], [ 0, 0, 0]]])

Levi-Civita Symbol of int type