Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 03:51

    anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

    added bottom_up simplification … (compare)

  • 03:05

    anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

    added testing for changes adde… (compare)

  • 02:57

    anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

    removed condition from leading … (compare)

  • Aug 09 10:29

    anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

    minor changes (compare)

  • Aug 09 05:13

    anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

    Fixed failing test (compare)

  • Aug 09 01:30

    anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

    Fixed code quality failure (compare)

  • Aug 05 12:45

    anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

    included exp forms for bessel f… (compare)

  • Aug 05 12:05

    anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

    Minor change (compare)

  • Aug 05 11:59

    anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

    Refactored mrv_leadterm in grun… (compare)

  • Aug 01 03:22

    anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

    Added e.is_negative case for be… (compare)

  • Aug 01 02:43

    anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

    hanled e.is_negative case for b… (compare)

  • Aug 01 02:03

    anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

    Replacing exp rewrite with trig… (compare)

  • Jul 31 11:41

    anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

    Minor changes (compare)

  • Jul 31 11:30

    anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

    added support when exponent of … (compare)

  • Jul 31 11:00

    anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

    Fixed leading term method for b… (compare)

  • Jul 28 04:15

    anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

    Added tests for 7224 (compare)

  • Jul 28 03:19

    anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

    Added tests for series of besse… (compare)

  • Jul 28 02:51

    anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

    Added series test for besseli f… (compare)

  • Jul 28 02:38

    anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

    Added tests for leading term me… (compare)

  • Jul 28 02:25

    anutosh491 on GSoC_Pr4.1_Implementing_few_series_methods_for_bessel_functions

    Added nseries method for bessel… (compare)

stuzenz
@stuzenz

Hi, There a way to get the negative representation of a matrix ? Example m1 = Matrix([[2, -1], [3, 12], [1.3, -2]]) applying a function that result to Matrix([[-2, 1], [-3, -12], [-1.3, 2]]) Thx in advance!

This will get the result

m = Matrix([[1, 2], [3, 4]])
m = -m
m
stuzenz
@stuzenz

Hi, There a way to get the negative representation of a matrix ? Example m1 = Matrix([[2, -1], [3, 12], [1.3, -2]]) applying a function that result to Matrix([[-2, 1], [-3, -12], [-1.3, 2]]) Thx in advance!

not sure if you need it as a function - but if you do - something like the below will get you there

def invert_function(matrix):
    result = -matrix
    print(str(result))
invert_function(Matrix([[1, 2], [3, 4]]))
# Returns Matrix([[-1, -2], [-3, -4]])
MiguelMonteiro
@MiguelMonteiro
Hello, I am trying to get the primitive of a very complex expression and I don't understand the meaning of the symbols c2 and c3 introduced in the result. Could someone explain please? Here is the code.
from sympy import IndexedBase, Sum, init_printing, integrate
from sympy.abc import I, N, j, t, x
from sympy.functions import conjugate, exp, sqrt

init_printing()
X = IndexedBase('X')

gamma = (1 / N) * Sum(exp(I * X[j] * t), (j, 0, N))
kernel = N / (2 * (N - 1)) * (1 + sqrt(1 - (4 * (N - 1)) / ((N ** 2) * gamma * conjugate(gamma))))
data = exp(-I * x * t)
kde = kernel * gamma * data
primitive = integrate(kde, t)
3 replies
Benoit Martin
@metabsd
@stuzenz Thx!
Benoit Martin
@metabsd
Hi, There is a way to see all step that use sympy to reduce a matrix ? .rref()
1 reply
stuzenz
@stuzenz

Hi, There is a way to see all step that use sympy to reduce a matrix ? .rref()
Hi, this is similar to a question of mine last week. I am using sympy as a peripheral tool to teach my daughters some math. I have noticed that with some expressions such as the below one that sympy will still simplify

sympify ("(sqrt(9))/(sqrt(16))", evaluate=False)

where the result is

3/4

Is it possible to have sympy do something more like this library? If not, I will just import the second library. Still, before I go there I thought I should understand if it is possible in sympy first.

https://github.com/connorferster/handcalcs

handcalcs is a library to render Python calculation code automatically in Latex, but in a manner that mimics how one might format their calculation if it were written with a pencil: write the symbolic formula, followed by numeric substitutions, and then the result.

Because handcalcs shows the numeric substitution, the calculations become significantly easier to check and verify by hand.

To answer my own question (in case anyone is interested in the same question). The python library, handcalcs, does what I need and already integrates well with sympy so that is fine - no real need for me to try and get the same result directly from sympy.

a,b,c = symbols("a b c")
d = a**2 + b*a
f = integrate(d, a)
# handcalcs integrates nicely with sympy
%%render sympy

a =5
b = 10
x = f
# I can get handcalcs to not evaluate/simplify
%%render symbolic

x_pos = sqrt(25) + sqrt(9)
# It seems I cannot with symy - but handcalcs (above example) works fine for me (with sympy) anyway
sympify(sqrt(25) +sqrt(9),evaluate=False)

So, I guess all is good. Thanks!

ref
https://github.com/connorferster/handcalcs#symbolic

You can view the above example results as an image here:
https://ibb.co/HDTvbH0

stuzenz
@stuzenz

Hi, There is a way to see all step that use sympy to reduce a matrix ? .rref()
Hi, this is similar to a question of mine last week. I am using sympy as a peripheral tool to teach my daughters some math. I have noticed that with some expressions such as the below one that sympy will still simplify

sympify ("(sqrt(9))/(sqrt(16))", evaluate=False)

where the result is

3/4

Is it possible to have sympy do something more like this library? If not, I will just import the second library. Still, before I go there I thought I should understand if it is possible in sympy first.

https://github.com/connorferster/handcalcs

handcalcs is a library to render Python calculation code automatically in Latex, but in a manner that mimics how one might format their calculation if it were written with a pencil: write the symbolic formula, followed by numeric substitutions, and then the result.

Because handcalcs shows the numeric substitution, the calculations become significantly easier to check and verify by hand.

To answer my own question (in case anyone is interested in the same question). The python library, handcalcs, does what I need and already integrates well with sympy so that is fine - no real need for me to try and get the same result directly from sympy.

a,b,c = symbols("a b c")
d = a**2 + b*a
f = integrate(d, a)
# handcalcs integrates nicely with sympy
%%render sympy

a =5
b = 10
x = f
# I can get handcalcs to not evaluate/simplify
%%render symbolic

x_pos = sqrt(25) + sqrt(9)
# It seems I cannot with symy - but handcalcs (above example) works fine for me (with sympy) anyway
sympify(sqrt(25) +sqrt(9),evaluate=False)

So, I guess all is good. Thanks!

ref
https://github.com/connorferster/handcalcs#symbolic

You can view the above example results as an image here:
https://ibb.co/HDTvbH0

just a quick side note to stop some frustration. I edited in the comments in the render cells after executing the cells. At the time, I didn't realise that the %%render has to be at the first line - so don't use comments in the same cell if you can help it.

Mirco
@mircodezorzi
Hello, any way to find the intersection between an parabolic cylinder and a cylinder? I have tried with [...] but didn't have any luck:
solve(z==y**2+4*x+6,x**2+y**2==9, z)
Francesco
@cescofran_gitlab
Are there any documentations I can look at for better understand
the Basic.__new__(cls, ..) pattern and use of related metaclasses in sympy?
Aaron Meurer
@asmeurer
I think it's not very well documented unfortunately, outside of the docstrings and comments in basic.py
Your best bet is to look at what a similar class to what you are trying to write is doing.
Francesco
@cescofran_gitlab
thanks @asmeurer is that pattern proper to sympy or is ispired from other sources I can look to?
Aaron Meurer
@asmeurer
I mean look at the sympy source code.
Paul Moore
@pfmoore
I'm playing with sympy as a possible way of doing some (relatively basic) probability calculations, using the sympy.Stats module. Doing something like X, Y = Die('X', 6), Die('Y', 6); density(X+Y) is neat, but if I wanted to get the distribution of the highest of the 2 rolls, how would I do that? density(max(X,Y)) doesn't work - I can see why, but I don't know where to look in the docs for something equivalent that would work. What's the best way for me to learn how to model calculations like this?
3 replies
Kuldeep Borkar Jr
@KuldeepBorkar
Hello developers,
I am Kuldeep Borkar from Maharashtra
in 1st year of B.tech Artificial Intelligence,
I was just looking for a great opportunity to make a great contribution to this organization and I found GSOC. It would be great help if I am guided for making contributions and yes join community to work on a project. I am comfortable with Python and C programming. I just now want to start making contributions to this organization, resolve issues and wish to collaborate with community.
Francesco
@cescofran_gitlab
@pfmoore have you tried with density(Max(X, Y))? Where Max is the sympy max operation vs max the python operation?
Paul Moore
@pfmoore
@cescofran_gitlab Ah, no, I hadn't spotted that there's a sympy max. (There's so much in sympy, it's hard to know you've missed something like that :-)) I'll give that a try, thanks.
Aaron Meurer
@asmeurer
If you have any suggestions on how we could improve the discoverability of such things in our documentation, let us know.
We are hoping to apply to Google Season of Docs this year with a project to improve the organization of our documentation.
2 replies
aplund
@aplund:matrix.org
[m]
If I have a Tuple() object, can I do .simplify() to simplify the elements in inplace?
aplund
@aplund:matrix.org
[m]
I'm pretty sure I have no idea what I'm talking aboout.
aplund
@aplund:matrix.org
[m]
should you be able to use generators? Tuple((simplify(x) for x in y)) ?
Aaron Meurer
@asmeurer
Tuple(*[simplify(x) for x in y])
There are no in-place operations in SymPy. All objects are immutable.
Sayandip Halder
@sayandip18
@mircodezorzi The == checks LHS and RHS for equality. I think what you meant is this
>>> solve(z-y**2+4*x+6,x**2+y**2-9, z)
[(x**2 + y**2 - 9, -4*x + y**2 - 6)]
aplund
@aplund:matrix.org
[m]
should this not simplify to 1:
a,b=symbols('a,b',is_positive=True)
simplify((a2-b2)/abs(a2-b2),assuming=a>b)
actually even a/abs(a) doesn't
or maybe the positive bit isn't working
laolux
@laolux:wolkendienst.dynv6.net
[m]
a/abs(a) works if you declare a=symbols('a', positive=True)
there is some difference between positive=True and is_positive=True
you can check by looking at a.assumptions0
aplund
@aplund:matrix.org
[m]
Is it possible to make a matrix with entries from a finite field?
I tried assigning FiniteField instances into a matrix, but they just get recalled as integers.
volokh0x
@volokh0x
Hello, I'm another beginner here and would want to help.
First-time involvement in open source is, probably, a good chance to ask the first a bit silly question, so mine is:
How strong should be someone's math background for contributing to this library? Is there any room for entry-level skills students?
Thanks
2 replies
Parnabrita Mondal
@hitblunders
hello, can anyone explain me what is happening here?
from sympy import *
from sympy.abc import x
f = x
maximum(f, x)
this gives me infinity. what exactly this means? The question might be a bit silly. But I am beginner here.
almighty123789
@almighty123789
@hitblunders Hi, I am assuming you understand what does maximum () does. If not, here's a simple explanation: it returns the maximum value of the function, in your case the function is x. You can also change the domain as per your requirement. Here's the relevant link
https://docs.sympy.org/latest/modules/functions/elementary.html
Parnabrita Mondal
@hitblunders
@almighty123789 thank you!
Benoit Martin
@metabsd
image.png
Hi, There a way to solve this with Sympy ? Thx in advance!
almighty123789
@almighty123789
@metabsd yeah there definitely is
x = symbols('x')
f = (6*x+13)/(15) - 2*x/5 -(3*x+5)/(5*x-25)
solveset(f,x) # OUTPUTS 20
Link to sympy tutorial https://docs.sympy.org/latest/tutorial/index.html
Constantin Mateescu
@costica1234_twitter
I have two PR's which have more or less been reviewed so far: sympy/sympy#20915 and sympy/sympy#20916. Would appreciate if someone could finally approve those rather small changes.
Benoit Martin
@metabsd
@almighty123789 Can I see the handcals ?
Benoit Martin
@metabsd
I also try to use sympy to find x,y with those example