You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The expression Simplify[Sqrt[x^2], x > 0] does not result in x, as expected
How to Reproduce
In Django go to a new notebook cell and enter the expression: Simplify[Sqrt[x^2], x > 0]
Simultaneously press the Shift+Enter keys
Output Given
The obtained result is: Sqrt[ x ^ 2 ]
Expected behavior
The expected result is: x
Your Environment
Software Information
Python
Python: 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
Implementation: CPython 3.10.12.final.0
Mathics3 Software
Mathics3 Django: 6.0.0
Mathics3: 6.0.2
Web Software
Django: 4.2.5
mathics-threejs-backend: 1.3.1
three.js: 146
MathJax: 2.7.9
Numeric Software
mpmath: 1.3.0
Numpy: 1.24.4
Sympy: 1.12
Optional Software
cython: Not installed
lxml: 4.9.3
networkx: 3.1
nltk: 3.8.1
psutil: Not installed
skimage: Not installed
scipy: 1.11.2
wordcloud: Not installed
Settings
Django
ALLOWED_HOSTS: []
DEBUG: True
DISPLAY_EXCEPTIONS: False
Mathics3 Django
Settings$PreferredBackendMethod: "sympy" This sets whether to use mpmath, numpy or Sympy for numeric and symbolic constants and methods, when there is a choice. Settings$QuotedStrings:
If this Boolean variable is set False, hide the quotes when the top-level value is a string.
Settings$TraceGet: If this Boolean variable is set True, 'Get' traces the lines it reads that start a new expression. Settings$UseSansSerif:
If this Boolean variable is set True, MathMLForm uses a Sans-Serif font.
System information
User Name: fpedraza
Process ID: 357
System Time Zone: -6.0
File Paths
Base Directory: /home/fpedraza/.local/lib/python3.10/site-packages/mathics
Home Directory: /home/fpedraza
Installation Directory: /home/fpedraza/.local/lib/python3.10/site-packages/mathics
Root Directory: /
Temporary Directory: /tmp
Workspace Database File: /home/fpedraza/.local/var/mathics/mathics.sqlite
Doctest Data: /home/fpedraza/.local/var/mathics/doc_html_data.pcl
Machine information
Machine Name: DESKTOP-Q6RKU5O
Machine: linux
Processor Type: x86_64
Memory Available: -1
System Memory: -1
Machine Precision: 15.954589770191003
Connection Information
HTTP User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Remote User:
Remote Address: 127.0.0.1
Remote Host:
Workarounds
The desired result can be obtained with the following SymPy command: refine(sqrt(x**2), Q.positive(x))
Priority
Additional context
The text was updated successfully, but these errors were encountered:
Description
The expression Simplify[Sqrt[x^2], x > 0] does not result in x, as expected
How to Reproduce
In Django go to a new notebook cell and enter the expression: Simplify[Sqrt[x^2], x > 0]
Simultaneously press the Shift+Enter keys
Output Given
The obtained result is: Sqrt[ x ^ 2 ]
Expected behavior
The expected result is: x
Your Environment
Software Information
Python
Python: 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
Implementation: CPython 3.10.12.final.0
Mathics3 Software
Mathics3 Django: 6.0.0
Mathics3: 6.0.2
Web Software
Django: 4.2.5
mathics-threejs-backend: 1.3.1
three.js: 146
MathJax: 2.7.9
Numeric Software
mpmath: 1.3.0
Numpy: 1.24.4
Sympy: 1.12
Optional Software
cython: Not installed
lxml: 4.9.3
networkx: 3.1
nltk: 3.8.1
psutil: Not installed
skimage: Not installed
scipy: 1.11.2
wordcloud: Not installed
Settings
Django
ALLOWED_HOSTS: []
DEBUG: True
DISPLAY_EXCEPTIONS: False
Mathics3 Django
Settings
$PreferredBackendMethod: "sympy" This sets whether to use mpmath, numpy or Sympy for numeric and symbolic constants and methods, when there is a choice. Settings
$QuotedStrings:If this Boolean variable is set False, hide the quotes when the top-level value is a string.
Settings
$TraceGet: If this Boolean variable is set True, 'Get' traces the lines it reads that start a new expression. Settings
$UseSansSerif:If this Boolean variable is set True, MathMLForm uses a Sans-Serif font.
System information
User Name: fpedraza
Process ID: 357
System Time Zone: -6.0
File Paths
Base Directory: /home/fpedraza/.local/lib/python3.10/site-packages/mathics
Home Directory: /home/fpedraza
Installation Directory: /home/fpedraza/.local/lib/python3.10/site-packages/mathics
Root Directory: /
Temporary Directory: /tmp
Workspace Database File: /home/fpedraza/.local/var/mathics/mathics.sqlite
Doctest Data: /home/fpedraza/.local/var/mathics/doc_html_data.pcl
Machine information
Machine Name: DESKTOP-Q6RKU5O
Machine: linux
Processor Type: x86_64
Memory Available: -1
System Memory: -1
Machine Precision: 15.954589770191003
Connection Information
HTTP User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Remote User:
Remote Address: 127.0.0.1
Remote Host:
Workarounds
The desired result can be obtained with the following SymPy command: refine(sqrt(x**2), Q.positive(x))
Priority
Additional context
The text was updated successfully, but these errors were encountered: