Function: bnrchar
Section: number_fields
C-Name: bnrchar
Prototype: GGDG
Help: bnrchar(G,g,{v}): returns all characters chi on G such that
 chi(g[i]) = e(v[i]); if v is omitted, returns all characters that are
 trivial on the g[i].
Doc: returns all characters $\chi$ on $G$ such that
 $\chi(g_{i}) = e(v_{i})$, where $e(x) = \exp(2i\pi x)$. $G$ is allowed to be a
 \var{bnr} struct (representing a ray class group) or a \var{znstar}
 (representing $(\Z/N\Z)^{*}$). If $v$ is omitted,
 returns all characters that are trivial on the $g_{i}$. Else the vectors $g$
 and $v$ must have the same length, the $g_{i}$ must be elements of $G$, and
 each $v_{i}$ is a rational number whose denominator must divide the order of
 $g_{i}$ in $G$.

 For convenience, the vector of the $g_{i}$
 can be replaced by a matrix whose columns give their discrete logarithm
 in $G$, for instance as given by \kbd{bnrisprincipal} if $G$ is a \var{bnr};
 in this particular case, $G$ can be any finite abelian group
 given by a vector of elementary divisors.

 \bprog
 ? G = bnrinit(bnfinit(x), [160,[1]], 1); /* (Z/160Z)^* */
 ? G.cyc
 %2 = [8, 4, 2]
 ? g = G.gen;
 ? bnrchar(G, g, [1/2,0,0])
 %4 = [[4, 0, 0]]  \\ a unique character
 ? bnrchar(G, [g[1],g[3]]) \\ all characters trivial on g[1] and g[3]
 %5 = [[0, 1, 0], [0, 2, 0], [0, 3, 0], [0, 0, 0]]
 ? bnrchar(G, [1,0,0;0,1,0;0,0,2])
 %6 = [[0, 0, 1], [0, 0, 0]]  \\ characters trivial on given subgroup

 ? G = znstar(75, 1);
 ? bnrchar(G, [2, 7], [11/20, 1/4])
 %8 = [[1, 1]] \\ Dirichlet char: chi(2) = e(11/20), chi(7) = e(1/4)
 @eprog
