RFC: step function and Pauli matrices
Dear all, please consider the attached patches: GiNaC is able to check whether expressions are sums of possymbols. We can use that to evaluate some step functions immediately: 0001-Evaluate-step-whenever-possible.patch This should be a generic transformation from an integral with a step function to step functions times integrals without: 0002-Integrate-when-integrand-is-a-product-with-a-step-fu.patch This patch implements Pauli matrices in the same manner as in color.cpp (shamelessly borrowed...): 0003-Implementation-of-Pauli-matrices.patch As opposed to the color algebra, a product of pauli objects can always be reduced to a linear combination of single pauli objects: 0004-New-function-pauli_normalize.patch Best wishes, Matthias Dellweg
Hi Matthias, On 12/20/2013 03:21 PM, Matthias Dellweg wrote:
GiNaC is able to check whether expressions are sums of possymbols. We can use that to evaluate some step functions immediately: 0001-Evaluate-step-whenever-possible.patch This should be a generic transformation from an integral with a step function to step functions times integrals without: 0002-Integrate-when-integrand-is-a-product-with-a-step-fu.patch This patch implements Pauli matrices in the same manner as in color.cpp (shamelessly borrowed...): 0003-Implementation-of-Pauli-matrices.patch As opposed to the color algebra, a product of pauli objects can always be reduced to a linear combination of single pauli objects: 0004-New-function-pauli_normalize.patch
I've had a quick look at your patches. The first two are lightweight and appear rather harmless, but they both introduce new functionality and should come with a test case. The third and fourth patch introduces Pauli matrices, they should not only come with extra test cases, but also with good documentation. If you intend to resubmit your patches, please also add comments in the preferred git format, so that they can be readily applied. -richy. -- Richard B. Kreckel <http://www.ginac.de/~kreckel/>
Am Mon, 13 Jan 2014 00:00:04 +0100 schrieb "Richard B. Kreckel" <kreckel@ginac.de>:
Hi Matthias,
I've had a quick look at your patches.
The first two are lightweight and appear rather harmless, but they both introduce new functionality and should come with a test case.
The third and fourth patch introduces Pauli matrices, they should not only come with extra test cases, but also with good documentation.
If you intend to resubmit your patches, please also add comments in the preferred git format, so that they can be readily applied.
-richy.
Hi Richard, thanks for the feedback. Starting with the easy bits, i tried to get the patches concerning the step functions ready by adding test-cases. But i failed to see what is the 'preferred git format'. I created the patches with 'git format-patch' so i thougt the were applicable with 'git am'. I could use a hint there. -g Matthias
Hi Richard, finally i created a repository to pull from. Hope this helps. The address would be: https://mdellweg@bitbucket.org/mdellweg/ginac.git The branches to look at are * step_patch for integration with step-functions you can describe piecewise defined functions this way I added some tests as you suggested * pauli_patch includes an implementation for Pauli matrices very similar to that of the color algebra This comes with tests and some documentation * rmatch_patch is a reimplementation of the matching infrastructure which matches an expression to a pattern (not the other way around). This gives the benefit, that an expairseq can match a single term when it consist only of this term and global wildcards. In ginsh: > match(sin(x), sin($0)*$1); {$1==1,$0==x} The step_patch could benefit there. Then again the match in expairseq is rewritten to match in more cases when several global wildcards are involved. For example > match(sin(x)*x*a, sin($0)*$0*$1); {$1==a,$0==x} And it now uses the ordering of the non wildcard terms for performance. All this is done without changing the existing API. If you want to see them all active at once (and a little more) you can try the devel branch. Looking forward to your comments. -g Matthias Am Tue, 14 Jan 2014 16:23:54 +0100 schrieb Matthias Dellweg <dellweg@tp1.uni-duesseldorf.de>:
Am Mon, 13 Jan 2014 00:00:04 +0100 schrieb "Richard B. Kreckel" <kreckel@ginac.de>:
Hi Matthias,
I've had a quick look at your patches.
The first two are lightweight and appear rather harmless, but they both introduce new functionality and should come with a test case.
The third and fourth patch introduces Pauli matrices, they should not only come with extra test cases, but also with good documentation.
If you intend to resubmit your patches, please also add comments in the preferred git format, so that they can be readily applied.
-richy.
Hi Richard, thanks for the feedback. Starting with the easy bits, i tried to get the patches concerning the step functions ready by adding test-cases. But i failed to see what is the 'preferred git format'. I created the patches with 'git format-patch' so i thougt the were applicable with 'git am'. I could use a hint there. -g Matthias
participants (2)
-
Matthias Dellweg
-
Richard B. Kreckel