Function: charconj
Section: number_theoretical
C-Name: charconj0
Prototype: GG
Help: charconj(cyc,chi): given a finite abelian group (by its elementary
 divisors cyc) and a character chi, return the conjugate character.
Doc: let \var{cyc} represent a finite abelian group by its elementary
 divisors, i.e. $(d_{j})$ represents $\sum_{j \leq k} \Z/d_{j}\Z$ with $d_{k}
 \mid \dots \mid d_{1}$; any object which has a \kbd{.cyc} method is also
 allowed, e.g.~the output of \kbd{znstar} or \kbd{bnrinit}. A character
 on this group is given by a row vector $\chi = [a_{1},\ldots,a_{n}]$ such that
 $\chi(\prod g_{j}^{n_{j}}) = \exp(2\pi i\sum_{j} a_{j} n_{j} / d_{j})$, where
 $g_{j}$ denotes the generator (of order $d_{j}$) of the $j$-th cyclic
 component. This function returns the conjugate character.
 \bprog
 ? cyc = [15,5]; chi = [1,1];
 ? charconj(cyc, chi)
 %2 = [14, 4]
 ? bnf = bnfinit(x^2+23);
 ? bnf.cyc
 %4 = [3]
 ? charconj(bnf, [1])
 %5 = [2]
 @eprog\noindent For Dirichlet characters (when \kbd{cyc} is
 \kbd{znstar(q,1)}), characters in Conrey representation are available,
 see \secref{se:dirichletchar} or \kbd{??character}:
 \bprog
 ? G = znstar(16, 1);  \\ (Z/16Z)^*
 ? charconj(G, 3)  \\ Conrey label
 %2 = [1, 1]~
 ? znconreyexp(G, %)
 %3 = 11 \\ attached Conrey label; indeed 11 = 3^(-1) mod 16
 ? chi = znconreylog(G, 3);
 ? charconj(G, chi)  \\ Conrey logarithm
 %5 = [1, 1]~
 @eprog

Variant: Also available is
 \fun{GEN}{charconj}{GEN cyc, GEN chi}, when \kbd{cyc} is known to
 be a vector of elementary divisors and \kbd{chi} a compatible character
 (no checks).
