Skip to content

sqrt and log of rational series #18

Closed

Description

@Sergey-A-Dovgal

It seems that if one of the coefficients of a rational power series is a non-integer then the condition that the constant term is one, fails.

Example.

import flint

QQ = flint.fmpq
log = flint.fmpq_series.log

# this one works ok
print(log(flint.fmpq_series([1,1])))

# here is I get ValueError: log() of power series: constant term must be one
print(log(flint.fmpq_series([1,1,QQ(3,8)])))

The same goes with sqrt.

My best guess is that it is because fmpq series is represented as a fraction, and it thinks that the leading term is equal to 8.

My flint version is 2.7.1, and python-flint is 0.3.0

Cheers

Activity

  1. changed the title [-]sqrt anf log of rational series[/-] [+]sqrt and log of rational series[/+] on Jul 21, 2021
  2. oscarbenjamin commented on Aug 26, 2024

    @oscarbenjamin
    Collaborator

    This one seems to be working fine now with python-flint 0.6.0:

    In [1]: import flint
       ...: 
       ...: QQ = flint.fmpq
       ...: log = flint.fmpq_series.log
       ...: 
       ...: # this one works ok
       ...: print(log(flint.fmpq_series([1,1])))
       ...: 
       ...: # here is I get ValueError: log() of power series: constant term must be one
       ...: print(log(flint.fmpq_series([1,1,QQ(3,8)])))
    x + (-1/2)*x^2 + 1/3*x^3 + (-1/4)*x^4 + 1/5*x^5 + (-1/6)*x^6 + 1/7*x^7 + (-1/8)*x^8 + 1/9*x^9 + O(x^10)
    x + (-1/8)*x^2 + (-1/24)*x^3 + 7/128*x^4 + (-11/320)*x^5 + 23/1536*x^6 + (-13/3584)*x^7 + (-17/16384)*x^8 + 73/36864*x^9 + O(x^10)

    Looks like it was fixed in c715d51 from gh-39 so python-flint 0.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions