AndreyBychkov / QBee

Quadratization of differential equations
MIT License
7 stars 2 forks source link

New laurent api #14

Closed AndreyBychkov closed 1 year ago

AndreyBychkov commented 1 year ago

Move management of Laurent polynomial both from parameters of polynomialize and polynomialize_and_quadratized functions and from EquationSystem to functions(..., laurent: bool = True)

Examples:

x = functions("x", laurent=True)
system = [(x, 1/x)]
polynomialize(system)  # Will not introduce new variables

y = functions("y", laurent=False)
system2 = [(y, 1/y)]
polynomialize(system2)  # Will introduce a new variable w_0 = 1/y

system3 = [
    (x, 1/x),
    (y, 1/y)
]
polynomialize(system3)  # Will introduce w_0 = 1/y, but will not introduce w_1 = 1/x

There are also some bug fixes needed for both `dev' and this branch.