Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default domain of SR.var() #36841

Merged
merged 5 commits into from
Jan 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you point out where in documentation you see this " considered in complex plane" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot from 2023-12-10 19-07-00

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!


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
Loading