io.github.daedalus/mcp-parigp
MCP server exposing cypari2 (PARI/GP) number theory library
Versions
0.1.0latestTools 143
pi Get the value of pi. Args: precision: Optional precision in bits. Returns: Value of pi. Example: >>> pi() 3.14159265358979
elleta Compute the eta-quotients for an elliptic curve. Args: E: Elliptic curve structure. Returns: [eta1, eta2, eta3]. Example: >>> E = ellinit("y^2 = x^3 - x")
eval_expression Evaluate a PARI/GP expression string. Args: expr: A PARI/GP expression as a string (e.g., "x^2 + 1", "factor(100)", "prime(10)"). For multiple computations, ALWAYS use vector expressions like "vector(15, n, qfbclassno(-4*n))" instead of for-loops with print statements. For-loops may cause timeouts. timeout: Maximum execution time in seconds (default 60). Note: This is a best-effort timeout and may not work reliably for long-running PARI operations written in C. Returns: The result of the evaluation converted to Python types. Example: >>> eval_expression("factor(100)") [[2, 2], [5, 2]] >>> eval_expression("prime(10)") 29 >>> eval_expression("vector(15, n, qfbclassno(-4*n))") [1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2, 4, 1, 2]
get_pari_version Get the PARI/GP version string. Returns: String describing the PARI version. Example: >>> get_pari_version() 'GP/PARI CALCULATOR Version 2.15...'
set_real_precision Set the PARI default real precision in decimal digits. Args: n: Number of decimal digits for precision. Returns: The previous precision value. Example: >>> set_real_precision(50) 15
get_real_precision Get the current PARI default real precision in decimal digits. Returns: Current precision in decimal digits. Example: >>> get_real_precision() 15
set_real_precision_bits Set the PARI default real precision in bits. Args: n: Number of bits of precision. Returns: The previous precision in bits. Example: >>> set_real_precision_bits(200) 53
get_real_precision_bits Get the current PARI default real precision in bits. Returns: Current precision in bits. Example: >>> get_real_precision_bits() 53
allocatemem Change the PARI stack size. Args: size: New stack size in bytes. If 0, doubles current size. sizemax: Maximum stack size in bytes. If 0, uses current maximum. Returns: Status message from PARI. Example: >>> allocatemem(10**7) 'PARI stack size set to 10000000 bytes...'
stacksize Get the current PARI stack size in bytes. Returns: Current stack size. Example: >>> stacksize() 8000000
stacksizemax Get the maximum PARI stack size in bytes. Returns: Maximum stack size. Example: >>> stacksizemax() 536870912
setrand Set PARI's random number seed. Args: seed: A positive integer or a GEN of type t_VECSMALL. Example: >>> setrand(42)
getrand Get PARI's current random number seed. Returns: The current random seed. Example: >>> getrand() [1, 2, 3, ...]
ellj Compute the j-invariant of an elliptic curve. Args: E: Elliptic curve structure or polynomial. Returns: The j-invariant. Example: >>> ellj("x^3 - x") 1728
primes Return prime numbers. Args: n: Either an integer (first n primes), or a list [a,b] for range, or start of range. end: End of prime range if n is a start value. Returns: List of prime numbers. Example: >>> primes(10) [2, 3, 5, 7, 11, 13, 17, 19, 23, 29] >>> primes(100, 200) [101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199]
prime Return the nth prime (1-indexed). Args: n: Which prime to return (1-indexed). Returns: The nth prime. Example: >>> prime(10) 29
factor Factor an integer. Args: n: Integer to factor. Returns: Factorization as list of [prime, exponent] pairs. Example: >>> factor(100) [[2, 2], [5, 2]]
isprime Test if an integer is prime. Args: n: Integer to test. Returns: True if n is prime, False otherwise. Example: >>> isprime(29) True >>> isprime(28) False
gcd Compute the greatest common divisor of two integers. Args: a: First integer. b: Second integer. Returns: The gcd of a and b. Example: >>> gcd(48, 18) 6
lcm Compute the least common multiple of two integers. Args: a: First integer. b: Second integer. Returns: The lcm of a and b. Example: >>> lcm(4, 6) 12
bezout Compute the Bezout identity: gcd(a,b) = a*u + b*v. Args: a: First integer. b: Second integer. Returns: Tuple (g, u, v) where g = gcd(a,b) and a*u + b*v = g. Example: >>> bezout(48, 18) (6, -1, 3)
phi Compute Euler's totient function phi(n). Args: n: Positive integer. Returns: phi(n) - count of integers <= n that are coprime to n. Example: >>> phi(10) 4
sigma Compute the sum of k-th powers of divisors of n. Args: n: Positive integer. k: Power exponent (default 1). Returns: Sum of k-th powers of divisors of n. Example: >>> sigma(10) 18 >>> sigma(10, 2) 130 >>> eval_expression("vector(10, n, sigma(n))") [1, 3, 4, 7, 6, 12, 8, 15, 13, 18]
moebius Compute the Möbius function mu(n). Args: n: Positive integer. Returns: mu(n): 1 if n is square-free with even number of prime factors, -1 if square-free with odd number of factors, 0 if n has a squared prime factor. Example: >>> moebius(10) 1 >>> moebius(30) -1 >>> moebius(12) 0 >>> eval_expression("vector(15, n, moebius(n))") [0, 1, -1, -1, 0, -1, 1, -1, 0, 0, 1, -1, 0, -1, 1]
jacobi Compute the Jacobi symbol (a/n). Args: a: Integer. n: Odd positive integer. Returns: The Jacobi symbol (a/n), which is -1, 0, or 1. Example: >>> jacobi(10, 21) -1
legendre Compute the Legendre symbol (a/p). Args: a: Integer. p: Odd prime. Returns: The Legendre symbol (a/p): -1, 0, or 1. Example: >>> legendre(10, 13) -1
znorder Compute the multiplicative order of x modulo n. Args: x: Integer coprime to n. n: Positive integer. Returns: The smallest k > 0 such that x^k ≡ 1 (mod n). Example: >>> znorder(2, 5) 4
znstar Compute the structure of (Z/nZ)*. Args: n: Positive integer. Returns: [N, cyc, gen] where N = phi(n), cyc gives the cyclic decomposition, and gen gives generators. Example: >>> znstar(12) [2, [2, 2], [...]]
factorial Compute the factorial n!. Args: n: Non-negative integer. Returns: n! as an integer. Example: >>> factorial(5) 120
binomial Compute the binomial coefficient C(n,k). Args: n: Non-negative integer. k: Non-negative integer. Returns: The binomial coefficient C(n,k). Example: >>> binomial(10, 3) 120
fibonacci Compute the nth Fibonacci number. Args: n: Non-negative integer. Returns: The nth Fibonacci number. Example: >>> fibonacci(10) 55 >>> eval_expression("vector(10, n, fibonacci(n))") [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
lucas Compute the nth Lucas number. Args: n: Non-negative integer. Returns: The nth Lucas number. Example: >>> lucas(10) 123 >>> eval_expression("vector(10, n, lucas(n))") [2, 1, 3, 4, 7, 11, 18, 29, 47, 76]
polcyclo Compute the nth cyclotomic polynomial. Args: n: Positive integer. v: Variable name (default 'x'). Returns: The nth cyclotomic polynomial. Example: >>> polcyclo(5) x^4 + x^3 + x^2 + x + 1
polchebyshev Compute the nth Chebyshev polynomial of the first kind. Args: n: Non-negative integer. v: Variable name (default 'x'). Returns: The nth Chebyshev polynomial T_n(x). Example: >>> polchebyshev(3) 4*x^3 - 3*x
pollegendre Compute the nth Legendre polynomial. Args: n: Non-negative integer. v: Variable name (default 'x'). Returns: The nth Legendre polynomial P_n(x). Example: >>> pollegendre(3) 5/2*x^3 - 3/2*x
polhermite Compute the nth Hermite polynomial (probabilists' version). Args: n: Non-negative integer. v: Variable name (default 'x'). Returns: The nth Hermite polynomial He_n(x). Example: >>> polhermite(3) x^3 - 3*x
polroots Compute the complex roots of a polynomial. Args: pol: Polynomial as a string (e.g., "x^3 - 1"). Returns: List of roots with multiplicities. Example: >>> polroots("x^2 + 1") [-I, I]
polrootsmod Compute the roots of a polynomial modulo p. Args: pol: Polynomial as a string. p: Prime modulus. Returns: List of roots modulo p. Example: >>> polrootsmod("x^2 + 1", 5) [2, 3]
polrootspadic Compute the p-adic roots of a polynomial. Args: pol: Polynomial as a string. p: Prime p. n: p-adic precision. Returns: List of p-adic roots. Example: >>> polrootspadic("x^2 - 2", 2, 5) [1 + 2 + 2^2 + 2^3 + 2^4 + O(2^5)]
factorpadic Factor a polynomial over the p-adic numbers. Args: pol: Polynomial as a string. p: Prime p. n: p-adic precision. Returns: Factorization as list of [factor, exponent] pairs. Example: >>> factorpadic("x^2 - 2", 2, 5)
deriv Compute the derivative of a polynomial. Args: pol: Polynomial as a string. v: Variable name. Returns: The derivative polynomial. Example: >>> deriv("x^3 + 2*x") 3*x^2 + 2
integ Compute the integral of a polynomial. Args: pol: Polynomial as a string. v: Variable name. Returns: The integral polynomial (constant term is 0). Example: >>> integ("x^2") 1/3*x^3
resultant Compute the resultant of two polynomials. Args: pol1: First polynomial. pol2: Second polynomial. v: Variable name. Returns: The resultant as an integer. Example: >>> resultant("x^2 - 1", "x^3 - 1") 0
disc Compute the discriminant of a polynomial. Args: pol: Polynomial. v: Variable name. Returns: The discriminant. Example: >>> disc("x^3 - 3*x + 1") 81
norm Compute the norm of a polynomial/algebraic number. Args: pol: Polynomial or algebraic number. v: Variable name. Returns: The norm. Example: >>> norm("Mod(x, x^2 + 1)")
trace Compute the trace of a polynomial/algebraic number. Args: pol: Polynomial or algebraic number. v: Variable name. Returns: The trace. Example: >>> trace("Mod(x, x^2 + 1)")
subst Substitute a variable in a polynomial. Args: pol: Polynomial. v: Variable to replace. expr: Expression to substitute. Returns: The substituted polynomial. Example: >>> subst("x^2 + 1", "x", "y + 1") (y + 1)^2 + 1
Mod Create a modular number or polynomial. Args: a: Value. b: Modulus (integer or polynomial). Returns: The modular object. Example: >>> Mod(2, 17) Mod(2, 17)
lift Lift a modular object (remove Mod wrapper). Args: mod: A modular object. Returns: The lifted value. Example: >>> lift(Mod(2, 17)) 2
centerlift Lift a modular object with centered representatives. Args: mod: A modular object. Returns: The centered lift. Example: >>> centerlift(Mod(10, 17)) -7
nfinit Initialize a number field defined by a polynomial. Args: pol: Defining polynomial as a string. Returns: The number field structure. Example: >>> nf = nfinit("x^2 + 1") >>> nf [y^2 + 1, [...], ...]
bnfinit Initialize a number field with Buchmann's algorithm. Args: pol: Defining polynomial. do_buchall: Compute full Buchmann's algorithm (default 0). Returns: The BNF structure. Example: >>> bnf = bnfinit("x^2 + 1")
bnrinit Initialize a ray number field (class field). Args: nf: Number field from nfinit. modulus: Modulus for ray class group. sign: 1 for full, -1 for real. Returns: The BNR structure. Example: >>> bnrinit(nfinit("x^2 + 1"), 1)
idealadd Add two ideals in a number field. Args: nf: Number field structure. ideal1: First ideal. ideal2: Second ideal. Returns: The sum ideal. Example: >>> nf = nfinit("x^2 + 1") >>> idealadd(nf, 2, 3)
idealmul Multiply two ideals in a number field. Args: nf: Number field structure. ideal1: First ideal. ideal2: Second ideal. Returns: The product ideal. Example: >>> nf = nfinit("x^2 + 1")
idealpow Compute a power of an ideal. Args: nf: Number field structure. ideal: Ideal to power. n: Exponent. Returns: The ideal^n. Example: >>> nf = nfinit("x^2 + 1")
idealfactor Factor an ideal in a number field. Args: nf: Number field structure. ideal: Ideal to factor. Returns: Factorization as [prime_ideals, exponents]. Example: >>> nf = nfinit("x^2 + 1")
ellinit Initialize an elliptic curve. Args: pol: Short Weierstrass equation (e.g., "y^2 = x^3 - x"). sign: 1 for minimal model. Returns: The elliptic curve structure. Example: >>> E = ellinit("y^2 = x^3 - x")
elladd Add two points on an elliptic curve. Args: E1: Elliptic curve (or point). E2: Elliptic curve (or point). Returns: The sum point. Example: >>> E = ellinit("y^2 = x^3 - x")
ellmul Multiply a point on an elliptic curve by an integer. Args: E: Elliptic curve structure. n: Integer multiplier. P: Point (optional, if E is a point). Returns: The point [n]P. Example: >>> E = ellinit("y^2 = x^3 - x")
ellorder Compute the order of a point on an elliptic curve. Args: E: Elliptic curve structure. P: Point on the curve. Returns: The order of P. Example: >>> E = ellinit("y^2 = x^3 - x")
elllog Compute the discrete logarithm of a point on an elliptic curve. Args: E: Elliptic curve structure. P: Point. G: Base point. Returns: The integer n such that n*G = P. Example: >>> E = ellinit("y^2 = x^3 - x")
ellap Compute the trace of Frobenius for an elliptic curve at prime p. Args: E: Elliptic curve structure. p: Prime. Returns: The trace of Frobenius a_p. Example: >>> E = ellinit("y^2 = x^3 - x") >>> ellap(E, 5) -2
elltors Compute the torsion subgroup of an elliptic curve. Args: E: Elliptic curve structure. Returns: [order, structure, generators]. Example: >>> E = ellinit("y^2 = x^3 - x") >>> elltors(E)
ellglobalred Compute the global reduction type of an elliptic curve. Args: E: Elliptic curve structure. Returns: [conductor, Kodaira type, global Tamagawa number]. Example: >>> E = ellinit("y^2 = x^3 - x")
elllocalred Compute the local reduction type at prime p. Args: E: Elliptic curve structure. p: Prime. Returns: [Kodaira type, exponent, Tamagawa number, conductor exponent]. Example: >>> E = ellinit("y^2 = x^3 - x")
ellheight Compute the canonical height of a point on an elliptic curve. Args: E: Elliptic curve structure. P: Point on the curve. flags: Computation flags. Returns: The canonical height. Example: >>> E = ellinit("y^2 = x^3 - x")
ellwp Compute the Weierstrass p-function. Args: E: Elliptic curve structure. n: Number of terms (default 6). flags: Computation flags. Returns: The Weierstrass p-function. Example: >>> E = ellinit("y^2 = x^3 - x")
ellzeta Compute the Weierstrass zeta function. Args: E: Elliptic curve structure. z: Point. Returns: The zeta value. Example: >>> E = ellinit("y^2 = x^3 - x")
matid Create an n x n identity matrix. Args: n: Size of the matrix. Returns: The n x n identity matrix. Example: >>> matid(3) [1, 0, 0; 0, 1, 0; 0, 0, 1]
matzero Create a zero matrix. Args: m: Number of rows (or size if n=0). n: Number of columns (default 0). Returns: The zero matrix. Example: >>> matzero(3) [0, 0, 0; 0, 0, 0; 0, 0, 0]
matdet Compute the determinant of a matrix. Args: m: Square matrix. Returns: The determinant. Example: >>> matdet("[1, 2; 3, 4]") -2
matinv Compute the inverse of a matrix. Args: m: Invertible square matrix. Returns: The inverse matrix. Example: >>> matinv("[1, 2; 3, 4]")
matrank Compute the rank of a matrix. Args: m: Matrix. Returns: The rank. Example: >>> matrank("[1, 2; 2, 4]") 1
matker Compute the kernel of a matrix. Args: m: Matrix. Returns: Basis of the kernel. Example: >>> matker("[1, 2; 2, 4]")
matimage Compute the image of a matrix. Args: m: Matrix. Returns: Basis of the image. Example: >>> matimage("[1, 2; 2, 4]")
mateigen Compute the eigenvalues of a matrix. Args: m: Square matrix. Returns: List of eigenvalues. Example: >>> mateigen("[1, 2; 2, 1]") [3, -1]
matcharpoly Compute the characteristic polynomial of a matrix. Args: m: Square matrix. v: Variable name. Returns: The characteristic polynomial. Example: >>> matcharpoly("[1, 2; 3, 4]") x^2 - 5*x - 2
hess Compute the Hessenberg form of a matrix. Args: m: Square matrix. Returns: The Hessenberg matrix. Example: >>> hess("[1, 2, 3; 4, 5, 6; 7, 8, 9]")
List Create an empty list or convert to a list. Args: x: Optional object to convert. Returns: A PARI list. Example: >>> L = List() >>> L.listput(42, 1)
Vec Convert to a row vector. Args: x: Object to convert. n: Optional length specification. Returns: Row vector. Example: >>> Vec("[1, 2, 3]") [1, 2, 3]
Col Convert to a column vector. Args: x: Object to convert. n: Optional length specification. Returns: Column vector. Example: >>> Col("[1, 2, 3]")
Mat Convert to a matrix. Args: x: Object to convert. Returns: Matrix. Example: >>> Mat("[1, 2, 3]") [1, 2, 3]
Set Convert to a set. Args: x: Object to convert. Returns: Sorted list of unique elements. Example: >>> Set("[1, 2, 1, 3]") [1, 2, 3]
Pol Convert to a polynomial. Args: x: Vector of coefficients or scalar. v: Variable name. Returns: Polynomial. Example: >>> Pol("[1, 2, 3]") x^2 + 2*x + 3
Polrev Convert to a polynomial (reverse order). Args: x: Vector of coefficients (constant term first). v: Variable name. Returns: Polynomial. Example: >>> Polrev("[1, 2, 3]") 3*x^2 + 2*x + 1
Ser Convert to a power series. Args: x: Polynomial or vector. v: Variable name. d: Precision (number of terms). Returns: Power series. Example: >>> Ser("x + 1", "x", 5) 1 + x + O(x^5)
euler Get Euler's constant. Args: precision: Optional precision in bits. Returns: Euler's constant gamma. Example: >>> euler() 0.5772156649015329
Catalan Get Catalan's constant. Args: precision: Optional precision in bits. Returns: Catalan's constant G. Example: >>> Catalan() 0.915965594177219
complex Create a complex number. Args: real: Real part. imag: Imaginary part. Returns: Complex number. Example: >>> complex(1, 2) 1 + 2*I
I Get the imaginary unit. Returns: The imaginary unit I = sqrt(-1). Example: >>> I() I
one Get the integer 1. Returns: Integer 1. Example: >>> one() 1
zero Get the integer 0. Returns: Integer 0. Example: >>> zero() 0
abs Compute absolute value. Args: x: Number or object. precision: Optional precision. Returns: Absolute value. Example: >>> abs(-5) 5
sqrt Compute square root. Args: x: Number. precision: Optional precision. Returns: Square root. Example: >>> sqrt(2) 1.414213562373095
exp Compute exponential. Args: x: Number. precision: Optional precision. Returns: e^x. Example: >>> exp(1) 2.71828182845905
log Compute natural logarithm. Args: x: Positive number. precision: Optional precision. Returns: log(x). Example: >>> log(2) 0.693147180559945
sin Compute sine. Args: x: Number (in radians). precision: Optional precision. Returns: sin(x). Example: >>> sin(0) 0
cos Compute cosine. Args: x: Number (in radians). precision: Optional precision. Returns: cos(x). Example: >>> cos(0) 1
tan Compute tangent. Args: x: Number (in radians). precision: Optional precision. Returns: tan(x). Example: >>> tan(0) 0
asin Compute arcsine. Args: x: Number in [-1, 1]. precision: Optional precision. Returns: arcsin(x). Example: >>> asin(0) 0
acos Compute arccosine. Args: x: Number in [-1, 1]. precision: Optional precision. Returns: arccos(x). Example: >>> acos(1) 0
atan Compute arctangent. Args: x: Number. precision: Optional precision. Returns: arctan(x). Example: >>> atan(0) 0
sinh Compute hyperbolic sine. Args: x: Number. precision: Optional precision. Returns: sinh(x). Example: >>> sinh(0) 0
cosh Compute hyperbolic cosine. Args: x: Number. precision: Optional precision. Returns: cosh(x). Example: >>> cosh(0) 1
tanh Compute hyperbolic tangent. Args: x: Number. precision: Optional precision. Returns: tanh(x). Example: >>> tanh(0) 0
asinh Compute inverse hyperbolic sine. Args: x: Number. precision: Optional precision. Returns: asinh(x). Example: >>> asinh(0) 0
acosh Compute inverse hyperbolic cosine. Args: x: Number >= 1. precision: Optional precision. Returns: acosh(x). Example: >>> acosh(1) 0
atanh Compute inverse hyperbolic tangent. Args: x: Number in (-1, 1). precision: Optional precision. Returns: atanh(x). Example: >>> atanh(0) 0
agm Compute the arithmetic-geometric mean. Args: x: First number. y: Second number (if None, uses x and 1). precision: Optional precision. Returns: AGM(x, y). Example: >>> agm(1, 2) 1.456791031...
airy Compute Airy functions Ai(z) and Bi(z). Args: z: Complex argument. Returns: [Ai, Bi]. Example: >>> airy(0) [0.3550280539..., 0.259285...]
genus2red Reduce a genus 2 curve. Args: P: Hyperelliptic polynomial y^2 = P. p: Optional prime for local reduction. Returns: Reduction data. Example: >>> genus2red("x^5 - 1")
algdep Find polynomial of degree k with integer coefficients approximating x. Args: x: Real/complex/p-adic number. k: Degree of polynomial. flag: Optional accuracy flag. Returns: Polynomial. Example: >>> algdep(sqrt(2), 2) x^2 - 2
vector Create a vector of length n. Args: n: Length. entries: List of entries (optional). Returns: Vector. Example: >>> vector(3, [1, 2, 3]) [1, 2, 3]
matrix Create an m x n matrix. Args: m: Number of rows (or size if n=0). n: Number of columns (default 0). entries: List of entries (optional). Returns: Matrix. Example: >>> matrix(2, 3, [1, 2, 3, 4, 5, 6]) [1, 2, 3; 4, 5, 6]
polsubcyclo Compute sub-cyclotomic polynomials. Args: n: Cyclotomic field order. d: Degree of subfield. v: Variable name. Returns: List of polynomials. Example: >>> polsubcyclo(8, 4) [x^4 + 1]
init_primes Initialize the primes table up to M. Args: M: Upper bound for primes. Example: >>> init_primes(1000)
addprimes Add primes to the factorisation table. Args: primes: List of primes to add (or None to get current list). Returns: Current list of extra primes. Example: >>> addprimes([10007])
removeprimes Remove primes from the factorisation table. Args: primes: List of primes to remove (or None to clear). Returns: Updated list of extra primes. Example: >>> removeprimes([10007])
ispower Test if n is a perfect k-th power. Args: n: Integer. k: Exponent (0 or omitted means test any power). Returns: k (exponent) if n is a perfect k-th power, else 0. Example: >>> ispower(64) 6
is_square Test if n is a perfect square. Args: n: Integer. Returns: True if n is a perfect square. Example: >>> is_square(25) True
nextprime Find the next prime after n. Args: n: Integer. Returns: The smallest prime > n. Example: >>> nextprime(10) 11
prevprime Find the previous prime before n. Args: n: Integer > 2. Returns: The largest prime < n. Example: >>> prevprime(10) 7
Qfb Create a binary quadratic form. Args: a, b, c: Coefficients (ax^2 + bxy + cy^2). D: Optional Shanks' distance. precision: Optional precision. Returns: Binary quadratic form. Example: >>> Qfb(1, 0, 1) Qfb(1, 0, 1)
qfbsolve Solve Q(x) = n for binary quadratic form Q. Args: Q: Binary quadratic form. n: Integer to represent. Returns: Solution vector or 0. Example: >>> qfbsolve(Qfb(1, 0, 1), 5)
qfbclassno Compute the class number of binary quadratic form discriminant D. Args: D: Discriminant (D ≡ 0, 1 mod 4, D > 0). flags: Computation flags. Returns: Class number. Example: >>> qfbclassno(5) 1 >>> eval_expression("vector(15, n, qfbclassno(-4*n))") [1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2, 4, 1, 2]
quadregulator Compute the regulator of real quadratic field. Args: D: Discriminant of real quadratic field. precision: Optional precision. Returns: Regulator. Example: >>> quadregulator(5)
quadratic_forms Compute reduced binary quadratic forms of discriminant D. Args: D: Discriminant (D ≡ 0, 1 mod 4, D ≠ 0). Returns: List of reduced forms. Example: >>> quadratic_forms(-3)
hilbert Compute the Hilbert symbol (n, m) or (n, m)_p. Args: n: Integer. m: Integer. p: Prime (0 for infinite place). Returns: Hilbert symbol (1 or -1). Example: >>> hilbert(-1, 5) 1
bessel Compute the Bessel function J_nu(x). Args: nu: Order. x: Argument. precision: Optional precision. Returns: Bessel J value. Example: >>> bessel(0, 1)
besselh Compute the Bessel function H_nu(x). Args: nu: Order. x: Argument. precision: Optional precision. Returns: Bessel H value. Example: >>> besselh(0, 1)
theta Compute the theta function theta(z, tau). Args: z: Complex parameter. tau: Lattice parameter. precision: Optional precision. Returns: Theta value. Example: >>> theta(0, I)
weber Compute the Weber function. Args: z: Complex parameter. flag: Which variant (0, 1, or 2). precision: Optional precision. Returns: Weber function value. Example: >>> weber(1)
eta Compute the Dedekind eta function. Args: z: Complex parameter with positive imaginary part. flag: Optional flag. precision: Optional precision. Returns: Eta value. Example: >>> eta(I)
modular_lambda Compute the modular lambda function. Args: tau: Lattice parameter (Im(tau) > 0). precision: Optional precision. Returns: Lambda value. Example: >>> modular_lambda(I)
modulr_sym Compute the modular symbol. Args: s: Complex number. g: Weight. precision: Optional precision. Returns: Modular symbol. Example: >>> modulr_sym(1 + I)
cusp_form Create a cusp form from its q-expansion. Args: q: q-expansion. weight: Weight. v: Variable number. Returns: Cusp form. Example: >>> cusp_form("q - q^5")
eisenstein Compute the Eisenstein series E_k(q). Args: k: Weight (even >= 2). n: Harmonic rank (default 1). precision: Optional precision. Returns: q-expansion of E_k. Example: >>> eisenstein(4)
bnrL1 Compute the first derivative of Artin L-function. Args: bnr: BNR structure from bnrinit. s: Complex parameter (optional). flag: Computation flag. Returns: L'-value. Example: >>> bnr = bnrinit(nfinit("x^2 + 1"), 1)
bnrrootnumber Compute the root number of Artin L-function. Args: bnr: BNR structure. character: Dirichlet character (optional). flag: Computation flag. Returns: Root number (±1). Example: >>> bnr = bnrinit(nfinit("x^2 + 1"), 1)
dirichlet Compute Dirichlet L-function. Args: s: Complex parameter. chi: Dirichlet character. precision: Optional precision. Returns: L(s, chi). Example: >>> dirichlet(2, 1)
lfun Compute general L-function. Args: s: Complex parameter. F: L-function data (optional). r: Derivative order. Returns: L(s) or its r-th derivative. Example: >>> lfun(2, 1)
lfuntheta Compute theta function of L-function. Args: t: Real parameter. F: L-function data. precision: Optional precision. Returns: Theta value. Example:
Permissions 0
No permissions indexed yet.