Re: [sympy] Dimensional Analysis

2022-11-21 Thread S.Y. Lee
If you expect correct decimal arithmetic and rounding, it could be better look at the alternatives like decimal library. I don't think that there is any good unified library of combining arbitrary precision arithmetic with different rounding

Re: [sympy] Issue with sympy quantum module

2022-11-21 Thread Oscar Benjamin
This is perhaps related to this issue: https://github.com/sympy/sympy/issues/24153 On Mon, 21 Nov 2022 at 17:03, Iman wrote: > > It runs on my PC. > I imported additional modules: > from sympy.physics.quantum import * > from sympy.physics.quantum.qubit import * > from sympy.physics.quantum.gate

Re: [sympy] Issue with sympy quantum module

2022-11-21 Thread Iman
It runs on my PC. I imported additional modules: from sympy.physics.quantum import * from sympy.physics.quantum.qubit import * from sympy.physics.quantum.gate import * from sympy.physics.quantum.grover import * from sympy.physics.quantum.qft import QFT, IQFT, Fourier from

Re: [sympy] Issue with sympy quantum module

2022-11-21 Thread Oscar Benjamin
On Mon, 21 Nov 2022 at 16:51, Iman wrote: > > I encountered a issue with the output of the following script: > > from sympy.physics.quantum import * > represent(Y(0)*Y(0),nqubits=1) > > I am expecting the ouput being a 2 by 2 identity matrix. But instead, > the output is a single number 1. > > I

Re[2]: Re[2]: [sympy] Sympy plotting module save figure as svg string

2022-11-21 Thread Антон Макаров
Thanks, i’ve already solve the problem… Отправлено из мобильной Почты Mail.ru понедельник, 21 ноября 2022 г., 19:52 +0300 от oscar.j.benja...@gmail.com : >I don't know how you get the handle to the matplotlib figure but there >should be some way to do it. > >On Mon, 21 Nov 2022 at 14:01,

Re: Re[2]: [sympy] Sympy plotting module save figure as svg string

2022-11-21 Thread Oscar Benjamin
I don't know how you get the handle to the matplotlib figure but there should be some way to do it. On Mon, 21 Nov 2022 at 14:01, Антон Макаров wrote: > > Thank you for answer. As far as I can understand the p1 variable in my sample > code is the object of mathplotlib library, right? > > > >

[sympy] Issue with sympy quantum module

2022-11-21 Thread Iman
Hello, I encountered a issue with the output of the following script: from sympy.physics.quantum import * represent(Y(0)*Y(0),nqubits=1) I am expecting the ouput being a 2 by 2 identity matrix. But instead, the output is a single number 1. I don't know if it is a bug in the Python code or I

Re[2]: [sympy] Sympy plotting module save figure as svg string

2022-11-21 Thread Антон Макаров
Thank you for answer. As far as I can understand the p1 variable in my sample code is the object of mathplotlib library, right? Отправлено из мобильной Почты Mail.ru понедельник, 21 ноября 2022 г., 16:51 +0300 от oscar.j.benja...@gmail.com : >SymPy's save function is just using matplotlib

Re: [sympy] Sympy plotting module save figure as svg string

2022-11-21 Thread Oscar Benjamin
SymPy's save function is just using matplotlib so the question is not really about SymPy but about matplotlib: https://stackoverflow.com/questions/5453375/matplotlib-svg-as-string-and-not-a-file Oscar On Mon, 21 Nov 2022 at 10:57, Anton Makarov wrote: > > Hi, i need to save figure from svg

[sympy] Sympy plotting module save figure as svg string

2022-11-21 Thread Anton Makarov
Hi, i need to save figure from svg plotting module as svg string in order to insert it latter in my web application. At the moment i can only save plot as svg file: from sympy import symbols from sympy.plotting import plot x = symbols('x') p1 = plot(x, x**2, x**3, (x, 0, 6), show = False)