Utils

Collection of utilities.

msinvar.utils.isiterable(i)[source]
msinvar.utils.cache(function)[source]
class msinvar.utils.vec[source]

Bases: object

static le(a, b)[source]
static iszero(a)[source]
static zero(a)
static equal(a, b)[source]
static vmin(a, b)[source]
static vmax(a, b)[source]
static scal(c, v)[source]
static dot(a, b)[source]
static sub(a, b)[source]
static add(a, b=None)[source]

Return the sum of vectors a, b. If b=None, return the sum of vectors in the list a.

static basis(i, n)[source]

Return the standard i-th basis vector of dimension n. Here 0<=i<n.

msinvar.utils.info(f)[source]
msinvar.utils.disp(G)[source]
msinvar.utils.timer(f, n=1000)[source]
msinvar.utils.set_plots()[source]
msinvar.utils.phi(q, n)[source]

Return \((q)_n=\prod_{i=1}^n(1-q^i)\).

If n is a list, apply phi() to all entries and take the product.

msinvar.utils.poch(a, q, n)[source]

Return the Pochhammer symbol \((a;q)_n=\prod_{i=0}^{n-1}(1-aq^i)\).

If n is a list, apply poch() to all entries and take the product.