algorithm - 如何在 bnfinit() 中构造字段?

标签 algorithm pari pari-gp

我是 PARI/GP 的新手,正在了解不同的数字字段。我正在尝试使用 bnfinit (第 23 个分圆字段)构造字段 k = Q(\zeta_23) 来运行以下脚本:

v=[]; w=[]; j=0; l=0;
forprime(p=29, 100000, {
    if(p%46==1, j++; if(#bnfisintnorm(k,p)>0,l++;w=[p];v=concat(v,w)))
});
print("Up to 100000 there are ",j," primes congruent to 1 mod 46 and ",l," are norms of principal ideals")

遇到 GP 会出现此错误,

<=1,j++;if(#bnfisintnorm(k,p)>0,l++;w=[p];v=concat(v,w))));print("Up to 100000 there are ",j," primes congruent to 1 mod 46 and ",l," are norms of principal ideals")

***   at top-level: ...00000,if(p%46==1,j++;if(#bnfisintnorm(k,p)>0,
***                                             ^--------------------
*** bnfisintnorm: incorrect type in checknf [please apply nfinit()] (t_POL).
(18:29) gp >

这应该找到素数 p,使得域 K 中存在范数为 p 的代数整数。

请问有什么帮助吗?谢谢。

最佳答案

您可以定义所需的数字字段,就像k = bnfinit(polcyclo(23))。所以你的代码将输出:

gp> Up to 100000 there are 429 primes congruent to 1 mod 46 and 141 are norms of principal ideals

希望有帮助。

关于algorithm - 如何在 bnfinit() 中构造字段?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46270410/

相关文章:

c - 为 C 使用 PARI 库

pari - 如何使用 PARI C 库

c++ - pari/gp 中 LLL 算法的代码

python - 快速替换字符串中的字符并检查子字符串是否是回文

无需直接转换器即可将货币转换为其他货币的算法

Pari C 中 t_REAL 的自定义精度位

pari - 从 PARI/GP 复制号码

algorithm - 如何找到函数的上界

python - 更高性能的方法从 python 执行这种类型的插入?