Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

what is sagemath equivalent to atomic type in Maple?

I am having hard time finding equivalent to atomic type in Maple to use in Sage for converting a function written in Maple to sagemath.

Here is description of what an atomic type is. Examples will make it more clear

type(1,'atomic');
                              true
type(1/2,'atomic');
                              true
type(.5,'atomic');
                              true
type(3+1/2*I,'atomic');
                              true
type(x+1/2*I,'atomic');
                             false
type("String",'atomic');
                              true
type(Name,'atomic');
                              true
type(a[b],'atomic');
                              true
type(a/b,'atomic');
                             false

In Mathematica, this is called AtomQ " yields True if expr is an expression which cannot be divided into subexpressions, and yields False otherwise."

Now, in sympy, the closest I found is is_Atom even though it is not exactly the same as Maple and Mathematica. In sagemath, the closest I found is expression.is_symbol() but this is also not exactly the same.

My question is, how does one check expression is atomic in sagemath? I googled and not able to find such command. I am sure it is there somewhere since this basic command.

Thank you --Nasser

what is sagemath equivalent to atomic type in Maple?

I am having hard time finding equivalent to atomic type in Maple to use in Sage for converting a function written in Maple to sagemath.

Here is description of what an atomic type is. Examples will make it more clear

type(1,'atomic');
                              true
type(1/2,'atomic');
                              true
type(.5,'atomic');
                              true
type(3+1/2*I,'atomic');
                              true
type(x+1/2*I,'atomic');
                             false
type("String",'atomic');
                              true
type(Name,'atomic');
                              true
type(a[b],'atomic');
                              true
type(a/b,'atomic');
                             false

In Mathematica, this is called AtomQ " yields True if expr is an expression which cannot be divided into subexpressions, and yields False otherwise."

Now, in sympy, the closest I found is is_Atom even though it is not exactly the same as Maple and Mathematica. In sagemath, the closest I found is expression.is_symbol() but this is also not exactly the same.same. Because I can't use it on variable of numeric type for example.

My question is, how does one check expression is atomic (in the above sense) in sagemath? I googled and not able to find such command. I am sure it is there somewhere since this basic command.

Thank you --Nasser