def multiply_PiT_v(self, nu, mu, lut, v): r"""Multiply the matrix :math:`\mathbf{P_i}^{\mathrm{T}}` by a vector :math:`\underline{v}` from the right. Do not construct the matrix explicitly. :param nu: The list :math:`\nu_i`. :param mu: The list :math:`\mu_i`. :param lut: The lookup table. :param v: The vector :math:`\underline{v} \in \mathbb{C}^{n(D,i)}`. """ res = zeros(nu.shape[0], dtype=v.dtype) for i in range(len(mu)): res[lut[mu[i]]] = 1.0 / sqrt(multinomial(mu[i])) * v[i] return res
def multiply_Pi_v(self, nu, mu, lut, v): r"""Multiply the matrix :math:`\mathbf{P_i}` by a vector :math:`\underline{v}` from the right. Do not construct the matrix explicitly. :param nu: The list :math:`\nu_i`. :param mu: The list :math:`\mu_i`. :param lut: The lookup table. :param v: The vector :math:`\underline{v} \in \mathcal{X}_i`. """ res = zeros(len(mu), dtype=v.dtype) for i in range(len(mu)): res[i] = sqrt(multinomial(mu[i])) * v[lut[mu[i]][0]] return res