def _norm_2_op(discr, num_components): from pytential import sym, bind if num_components is not None: from pymbolic.primitives import make_sym_vector v = make_sym_vector("integrand", num_components) integrand = sym.real(np.dot(sym.conj(v), v)) else: integrand = sym.abs(sym.var("integrand"))**2 return bind(discr, sym.integral(discr.ambient_dim, discr.dim, integrand))
def _norm_op(discr, num_components): from pytential import sym, bind if num_components is not None: from pymbolic.primitives import make_sym_vector v = make_sym_vector("integrand", num_components) integrand = sym.real(np.dot(sym.conj(v), v)) else: integrand = sym.abs(sym.var("integrand"))**2 return bind(discr, sym.integral(integrand))