Skip to content

Commit

Permalink
Changed the default domain of SR.var() to complex
Browse files Browse the repository at this point in the history
This is a fix to the issue trac:`36833`. Variables whose domain is
not defined should be considered in the complex plane by default
as described in the documentation.
  • Loading branch information
RuchitJagodara committed Dec 8, 2023
1 parent 272582b commit 7d10eb2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/sage/symbolic/ring.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ cdef class SymbolicRing(sage.rings.abc.SymbolicRing):
if asm.has(symbol):
asm.forget()

def var(self, name, latex_name=None, n=None, domain=None):
def var(self, name, latex_name=None, n=None, domain="complex"):
r"""
Return a symbolic variable as an element of the symbolic ring.
Expand Down Expand Up @@ -862,6 +862,16 @@ cdef class SymbolicRing(sage.rings.abc.SymbolicRing):
Traceback (most recent call last):
...
ValueError: cannot specify n for multiple symbol names
Check that :trac:`36833` is fixed: Variables whose domain is not
defined should be considered in complex plane as described in documentation::
sage: y = SR.var("y"); y
y
sage: f = y * conjugate(y); f
f
sage: f.factor()
y*conjugate(y)
"""
if isinstance(name, Expression):
return name
Expand Down

0 comments on commit 7d10eb2

Please sign in to comment.