I need to do some numerical computation on special values of a Hecke L-function $L(s,\chi)$. To do this, I want to construct a Hecke character in MAGMA, given that I know its infinity type.


In other words, suppose we are working on a totally real field $K$. My Hecke character $\chi$ is first defined over the principal ideals by 


$$\chi((\alpha))=\prod sgn(\sigma\_i(\alpha))^{m\_i}|\sigma\_i(\alpha)|^{n\_i}$$


where $\sigma\_i$'s are the real embeddings, $m\_i=0$ or $1$, and $n\_i\in \mathbb{C}$. For some good values of $m,n$ this can be extended to all ideals, thus becomes a Hecke character.


I tried to read <https://magma.maths.usyd.edu.au/magma/handbook/text/410> for related information. It looks like the functions related to Hecke Grössencharacters are close to what I need, but it requires CM field to work, while I want to deal, say with $K=\mathbb{Q}(\sqrt{3})$.


Edit1: Thanks to Jeremy Rouse, I read <http://magma.maths.usyd.edu.au/magma/handbook/text/1485> about creating a general L-series in Magma. It assumes that the shifts in the gamma factors are rational, while I want to do the following example:


$K=\mathbb{Q}(\sqrt{3})$, $\chi(\alpha)=Sgn(\alpha\alpha')(\alpha/\alpha')^{i\pi/R}$ where $R$ is the regulator (so that $\chi$ is $1$ on units).


$L(\chi)=\sum\_{I\subset O\_K}\chi(I)N(I)^{-s}$, whose gamma factor is


$$\nu(s)=(dπ^{−2})^{s/2}Γ(s/2+1/2+πi/2R)Γ(s/2+1/2−πi/2R).$$


I start with the following Magma code:



```
K:=QuadraticField(3);
C<i>:=ComplexField();
pi:=Pi(C);
d:=AbsoluteDiscriminant(K); d;
r:=Regulator(K);
mu:=pi/2/r; mu;
L := LSeries(1, [mu,-mu], d, 0: Sign:=1);
N := LCfRequired(L); N;

```

which results in "Runtime error in 'LSeries': elements of gamma must be integer or rational numbers". (So as Jeremy commented later, this cannot be doen with Magma. with add some detail if I work it out.)



construct a Hecke character in MAGMA with given infinity type
It sounds like Magma does not currently include the exact functionality that you want to use. An alternative that you could try is manually building the $L$-function you wish to evaluate numerically (see the section of the Magma documentation "Arithmetic Geometry - $L$-functions - Constructing a general L-series"). This accesses the algorithms (primarily based on work of Tim Dokchitser) for computing $L$-functions. I have manually built and evaluated many $L$-functions (including for example, symmetric power $L$-functions of modular forms).


In order to do this, you need to know the Euler factors, line of symmetry, conductor, and Gamma factors. (Magma will guess the sign of the functional equation for you.) This information was worked out by Hecke - an excellent modern reference is Iwaniec's "Topics in Classical Automorphic Forms" - Section 12.2.


