Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make polynomial .diff() accept optional argument times for repeated differentiation. #1578

Closed
ncalexan mannequin opened this issue Dec 21, 2007 · 13 comments
Closed

Make polynomial .diff() accept optional argument times for repeated differentiation. #1578

ncalexan mannequin opened this issue Dec 21, 2007 · 13 comments

Comments

@ncalexan
Copy link
Mannequin

ncalexan mannequin commented Dec 21, 2007

Make polynomial .diff() accept optional argument times for repeated differentiation.

Makes diff do its thing multiple time if requested.

-    def diff(self, MPolynomial_libsingular variable, have_ring=True):
+    def diff(self, MPolynomial_libsingular variable, times=1, have_ring=True):

Component: commutative algebra

Keywords: polynomial diff times repeat

Issue created by migration from https://trac.sagemath.org/ticket/1578

@ncalexan ncalexan mannequin added this to the sage-2.10.3 milestone Dec 21, 2007
@ncalexan ncalexan mannequin assigned malb Dec 21, 2007
@ncalexan
Copy link
Mannequin Author

ncalexan mannequin commented Dec 21, 2007

comment:1

Hmm, bundle and patch might need to be rebased. Sorry.

@sagetrac-mabshoff sagetrac-mabshoff mannequin changed the title Make polynomial .diff() accept optional argument times for repeated differentiation. [with broken patch] Make polynomial .diff() accept optional argument times for repeated differentiation. Dec 21, 2007
@mwhansen
Copy link
Contributor

comment:3

The failures are okay, since they just have redundant information. I tested things out and all tests passed.

@mwhansen mwhansen changed the title [with broken patch] Make polynomial .diff() accept optional argument times for repeated differentiation. Make polynomial .diff() accept optional argument times for repeated differentiation. Dec 22, 2007
@rlmill rlmill mannequin changed the title Make polynomial .diff() accept optional argument times for repeated differentiation. [needs rebasing] Make polynomial .diff() accept optional argument times for repeated differentiation. Dec 23, 2007
@ncalexan ncalexan mannequin changed the title [needs rebasing] Make polynomial .diff() accept optional argument times for repeated differentiation. Make polynomial .diff() accept optional argument times for repeated differentiation. Dec 29, 2007
@ncalexan
Copy link
Mannequin Author

ncalexan mannequin commented Jan 13, 2008

Attachment: ncalexan-mpoly-diff-times-updated.patch.gz

This should be the final version; use this over the two earlier bundles and one earlier patch.

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Jan 13, 2008

comment:6

I deleted the older patches and bundles.

Cheers,

Michael

@robertwb
Copy link
Contributor

comment:7

'times' seems like an odd name for the argument--it returns the "times-th derivative"?

@malb
Copy link
Member

malb commented Jan 13, 2008

comment:8

How about accepting monomials instead of variables only. Then x2 would encode 2-times x, and x2y3 would mean 3-times y and 2-times x.

@robertwb
Copy link
Contributor

comment:9

I don't know if we implement any, but there are functions such that d^2f/dxdy != d^2 f/dydx.

However, I think the ability to pass in a monomial is an excellent idea. Perhaps beyond the scope of this patch though.

@malb malb assigned ncalexan and unassigned malb Jan 18, 2008
@jasongrout
Copy link
Member

comment:11

In mathematica, you can pass a list to the differentiate command and the function will be differentiated with respect to successive elements of the list. So maybe something like:

f.diff([x,y,y,x])

could specify differentiating first wrt x, then y, then y, and then x again.

The command in the patch could be invoked as:

f.diff([x]*3)

I agree that f.diff(x,3) looks better, though.

@jasongrout
Copy link
Member

comment:12

We should probably note that this is supported by symbolic polynomials already.

sage: x,y=var('x y')
sage: f=exp(2*x*y)
sage: f.diff(x)
2*y*e^(2*x*y)
sage: f.diff(x,x)
4*y^2*e^(2*x*y)
sage: f.diff(x,2)
4*y^2*e^(2*x*y)
sage: f.diff(x,2,y)
8*x*y^2*e^(2*x*y) + 8*y*e^(2*x*y)
sage: f.diff(x,2,y,y)
16*x^2*y^2*e^(2*x*y) + 32*x*y*e^(2*x*y) + 8*e^(2*x*y)
sage: f.diff(x,2,y,2)
16*x^2*y^2*e^(2*x*y) + 32*x*y*e^(2*x*y) + 8*e^(2*x*y)

@JohnCremona
Copy link
Member

comment:13

The patch looks ok to me, looking at the diffs (I have not tried applying it).

@sagetrac-dmharvey
Copy link
Mannequin

sagetrac-dmharvey mannequin commented Feb 28, 2008

comment:14

there is action on this at #753

@sagetrac-dmharvey
Copy link
Mannequin

sagetrac-dmharvey mannequin commented Mar 3, 2008

comment:15

I am closing this since it has been superseded by #753.

@sagetrac-dmharvey sagetrac-dmharvey mannequin removed the s: needs review label Mar 3, 2008
@sagetrac-dmharvey sagetrac-dmharvey mannequin closed this as completed Mar 3, 2008
@sagetrac-mabshoff sagetrac-mabshoff mannequin removed the r: duplicate label Mar 3, 2008
@sagetrac-mabshoff sagetrac-mabshoff mannequin reopened this Mar 3, 2008
@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Mar 3, 2008

comment:17

This isn't really a duplicate and I consider this fixed. It looks like a borderline case, so I tend to call those tickets fixed.

Cheers,

Michael

@sagetrac-mabshoff sagetrac-mabshoff mannequin closed this as completed Mar 3, 2008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants