**, *^ are not valid Mathematica syntax for powers.
** is noncommutative multiplication
https://reference.wolfram.com/language/ref/NonCommutativeMultiply.html
and *^ is scientific notation
https://reference.wolfram.com/language/guide/Syntax.html
Also ^^ is the  nnnn expressed in b-base

So the reason that ** had possibly worked before was that although it is 
not parsed correctly in Mathematica parser, 
it somewhat got parsed in sympify as a valid python syntax and I think that 
it is completely wrong to parse it as power.

Actually, they are rarely used syntax for Mathematica that I didn't know 
that they existed, 
and especially *^ and ^^ are much more limited that it only works with 
restricted classes of digits, with no symbolic capability,
and you can achieve the same thing with other Mathematica functions like 
FromDigits.
For example, the bases for ^^ is restricted only for 2~36 because after it 
exceeds 37, you will exhaust every digits 0~9 and English alphabets A~Z, 
so if we are going to build parser for that, it must be considered.


On Tuesday, October 13, 2020 at 12:23:31 AM UTC+9 asme...@gmail.com wrote:

> It's probably not supported, but it could be added. The Mathematica
> parser is still relatively rudimentary, so a lot of syntax features of
> Mathematica aren't supported.
>
> Aaron Meurer
>
> On Mon, Oct 12, 2020 at 9:04 AM Roberto <franceschi...@gmail.com> wrote:
> >
> > from sympy.parsing.mathematica import mathematica
> >
> > Power with ** works
> > _mma = mathematica('3**2', {})
> > also the ^ works
> > _mma = mathematica('3^2', {})
> > but there seems to be a problem with *^ notation
> > _mma = mathematica('3*^2', {})
> > as ^ is parsed as **, without checking ahead if there is any "*^"
> > SympifyError: Sympify of expression 'could not parse '3***2'' failed, 
> because of exception being raised: SyntaxError: invalid syntax (<string>, 
> line 1)
> >
> > Am I misusing the parser?
> >
> > --
> > You received this message because you are subscribed to the Google 
> Groups "sympy" group.
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to sympy+un...@googlegroups.com.
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/d21ef284-37bb-4f4f-93c1-16efbcc24aadn%40googlegroups.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/6f0a5492-3e2b-4e24-8a38-737e17944953n%40googlegroups.com.

Reply via email to