tensorPower(exponent) {
        if (!Number.isInteger(exponent) || exponent < 0) {
            throw new DetailedError("Bad exponent", {exponent});
        }
        let t = Matrix.identity(1);
        let p = this;
        for (let m = 1; m <= exponent; m *= 2) {
            if ((m & exponent) !== 0) {
                t = t.tensorProduct(p);
            }
            p = p.tensorProduct(p);
        }
        return t;
    }
Returns the result of tensor-product-ing the receiving matrix with itself the given number of times.
@param {!int} exponent The number of times the matrix is tensor-product-ed with itself.
@returns {!Matrix}