ecterrab

14540 Reputation

24 Badges

20 years, 23 days

MaplePrimes Activity


These are answers submitted by ecterrab

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Note also that if you use eval instead of subs, you actually don't need to use simplify or Simplify or anything else: the expression automatically cancels upon evaluation of the commutators.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Hi NOh

The issue is known. You can fix this and related (so called premature evaluation) problems by redefining sum as in:

 

To see an explanation of what this does check please the help page ?Updates,Maple18,Physics, the section on "New Enhanced Modes in Physics Setup", item 4.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Hi Andriy

> with(Physics):

> Setup(op = A):

> type(A^5, '`^`'(Library:-PhysicsType:-ExtendedQuantumOperator, posint));

                          true

So:
* Note that after having loaded Physics, `^` is the same as Physics:-`^`, and different from :-`^`
* To have the type working properly you need to quote the function call (otherwise, Physics:-`^` gets executed over commutative objects, and so it returns in terms of the commutative :-`^`, not Physics:-`^`, and the match you are expecting doesn't happen)
* Note you do not need to load the Library to have the Physics types working, just invoke them as you see in the above using the long form.

If you want to have this type working with a symbolic power too - say n with assumptions - it also works. Use type/satisfies. For instance as in

> assume(n, posint)

> type(A^n, '`^`'(Library:-PhysicsType:-ExtendedQuantumOperator, satisfies(n -> is(n,posint))));

                               true

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Hi

Instead of 'assume', I would use 'assuming' (for details please see the help page for assuming), but independent of that, here is how you can achieve what you want, in somehow different forms. I am performing the operation on a single exponential just to pass the idea, you can also play around with the different simplifiers:

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Hi Soren

Good catch again, this one is now also fixed. Somewhere in the internal routines the code was performing A^(-1) . Ket by first performing A . Ket and looking for a result proportional to a Ket, all correct, but missing the case A . Ket = 0, that would take you to the error 0^(-1) you expected and didn't receive, receiving instead the operation A^(-1) . Ket uncomputed.

The fix is available to everyone in the usual place, the Maplesoft R&D Physics webpage.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Hi Tucker

Differentiating with respect to a Matrix, or tensor function, works fine, just use tensor notation, and it works regardless of whether you have set the dimension. Here is how you do it. By the way I run the following using the latest version of Physics, that you can update (I recommend this) from the Maplesoft R&D Physics webpage.

 

restart; with(Physics)

The use of tensor notation here is just to represent matrix operations, so this is tensors in an Euclidean geometry (no relativity around), and according to what you say the dimension of this space is 6, so

Setup(metric = Euclidean, dimension = 6, quiet)

Define now three tensors, as you did, and R is not necessary but I will use it to refer to the result

Define(s, A, R)

`Defined objects with tensor properties`

 

{A, R, s, Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[alpha, beta, kappa, lambda, mu, nu]}

(1)

Your computation, in tensor notation, is thus written by rewriting Transpose(s).A.s

s[mu]*A[mu, nu]*s[nu]

s[mu]*A[mu, nu]*s[nu]

(2)

You want now to differentiate (2) with respect to s. Just go ahead as you did, only using tensor notation, so also for the differentiation variable

R[rho] = Diff(s[mu]*A[mu, nu]*s[nu], s[rho])

R[rho] = Diff(s[mu]*A[mu, nu]*s[nu], s[rho])

(3)

Now: you used Diff, and here me too to follow you, but Diff, like %diff, are inert representations for the derivative, they do not actually compute anything, they only represent the operation. So to actually compute this derivative, either use diff instead, or apply value to the result above, both work the same way. For example

value(R[rho] = Diff(s[mu]*A[mu, nu]*s[nu], s[rho]))

R[rho] = A[mu, nu]*Physics:-g_[mu, rho]*s[nu]+A[mu, nu]*Physics:-g_[nu, rho]*s[mu]

(4)

And this is the answer to your question. This result, however, can still be simplified. Recalling: for tensors, Maple uses the sum rule for repeated indices, so:

Simplify(R[rho] = A[mu, nu]*s[mu]*Physics[g_][nu, rho]+A[mu, nu]*s[nu]*Physics[g_][mu, rho])

R[rho] = A[mu, rho]*s[mu]+A[rho, mu]*s[mu]

(5)

You may also want to see the actual components of this tensorial derivative just computed. You can do that in three ways. First, use Physics:-TensorArray , as in

TensorArray(R[rho] = A[mu, rho]*s[mu]+A[rho, mu]*s[mu])

Array(%id = 18446744078499257750)

(6)

Note the dimensions of his array

"ArrayDims(?)"

1 .. 6

(7)

Or you may prefer to use Library:-TensorComponents, as in

Library:-TensorComponents(R[rho] = A[mu, rho]*s[mu]+A[rho, mu]*s[mu])

[R[1] = 2*A[1, 1]*s[1]+A[1, 2]*s[2]+A[1, 3]*s[3]+A[1, 4]*s[4]+A[1, 5]*s[5]+A[1, 6]*s[6]+A[2, 1]*s[2]+A[3, 1]*s[3]+A[4, 1]*s[4]+A[5, 1]*s[5]+A[6, 1]*s[6], R[2] = A[1, 2]*s[1]+A[2, 1]*s[1]+2*A[2, 2]*s[2]+A[2, 3]*s[3]+A[2, 4]*s[4]+A[2, 5]*s[5]+A[2, 6]*s[6]+A[3, 2]*s[3]+A[4, 2]*s[4]+A[5, 2]*s[5]+A[6, 2]*s[6], R[3] = A[1, 3]*s[1]+A[2, 3]*s[2]+A[3, 1]*s[1]+A[3, 2]*s[2]+2*A[3, 3]*s[3]+A[3, 4]*s[4]+A[3, 5]*s[5]+A[3, 6]*s[6]+A[4, 3]*s[4]+A[5, 3]*s[5]+A[6, 3]*s[6], R[4] = A[1, 4]*s[1]+A[2, 4]*s[2]+A[3, 4]*s[3]+A[4, 1]*s[1]+A[4, 2]*s[2]+A[4, 3]*s[3]+2*A[4, 4]*s[4]+A[4, 5]*s[5]+A[4, 6]*s[6]+A[5, 4]*s[5]+A[6, 4]*s[6], R[5] = A[1, 5]*s[1]+A[2, 5]*s[2]+A[3, 5]*s[3]+A[4, 5]*s[4]+A[5, 1]*s[1]+A[5, 2]*s[2]+A[5, 3]*s[3]+A[5, 4]*s[4]+2*A[5, 5]*s[5]+A[5, 6]*s[6]+A[6, 5]*s[6], R[6] = A[1, 6]*s[1]+A[2, 6]*s[2]+A[3, 6]*s[3]+A[4, 6]*s[4]+A[5, 6]*s[5]+A[6, 1]*s[1]+A[6, 2]*s[2]+A[6, 3]*s[3]+A[6, 4]*s[4]+A[6, 5]*s[5]+2*A[6, 6]*s[6]]

(8)

The above is a list with 6 equations. Finally you can also define this tensorial result (5) itself as a tensor, in order to use R[mu] to refer to each of the components, as follows:

Define(R[rho] = A[mu, rho]*s[mu]+A[rho, mu]*s[mu])

`Defined objects with tensor properties`

 

{A[mu, nu], Physics:-Dgamma[mu], Physics:-Psigma[mu], R[rho], Physics:-d_[mu], Physics:-g_[mu, nu], s[mu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[alpha, beta, kappa, lambda, mu, nu]}

(9)

R[1]

2*A[1, 1]*s[1]+A[1, 2]*s[2]+A[1, 3]*s[3]+A[1, 4]*s[4]+A[1, 5]*s[5]+A[1, 6]*s[6]+A[2, 1]*s[2]+A[3, 1]*s[3]+A[4, 1]*s[4]+A[5, 1]*s[5]+A[6, 1]*s[6]

(10)

R[2]

A[1, 2]*s[1]+A[2, 1]*s[1]+2*A[2, 2]*s[2]+A[2, 3]*s[3]+A[2, 4]*s[4]+A[2, 5]*s[5]+A[2, 6]*s[6]+A[3, 2]*s[3]+A[4, 2]*s[4]+A[5, 2]*s[5]+A[6, 2]*s[6]

(11)

The same computation can be done in an arbitrary metric, not an Euclidean one. For that purpose, in the first line, enter Setup(metric = arbitrary, dimension = 6) (that is, 'arbitrary' instead of 'Euclidean') and in the left-hand side of (3) use R[`~rho`] instead of R[rho] so that left and right hand sides both have the free index contravariant, and rerun the worksheet.

NULL

 

Download Differentiate_with_respect_ot_a_tensor.mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Hi Sören

This was indeed a problem in a computation running under assumptions (mainly that occupation numbers are actually positive integers). It is fixed now. You can download the fix as usual from Maplesoft's R&D Physics webpage. By the way I am curious about your computation ... this somehow symmetric combination of a1 and a2, a negative power of quantum operator applied to Kets, etc. You described partly the problem, but could you tell some more about it? (E.g. what terms you wanted to pick or what comes next?) Thanks.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Hi

Try normal(eq3) and you receive 

-omega[0]^2*X[0] = -omega[0]^2*X[0]

At the same time the system sees diff(x(t),t,t) around, but the numerator of the above does not depen on it. The problem you are presenting to dsolve is then ill posed. It is not actually an ODE but an algebraic equation of the form A = A.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

Hi NOh,

No you cannot. In this moment, LinearAlgebra, and various other commands, still compute assuming a commutative domain. The introduction of noncommutative *algebraic* objects is new with the Physics package, and is extending through the library.

If however you could post a woksheet showing the matrix, I can probably show you how you use the existing tools for handling noncommutative products in order to compute the eigenvalues and eigenvectors, and perhaps use this conversation as a base to prepare a new Physics:-Library:-Command with this relevant functionality.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Hi Age

The issue you reported, that interruption when setting the algebra for Dirac matrices when using actual matrices instead of tensor notation, is fixed and the fix uploaded to the R&D Maplesoft Physics page, from where it can be downloaded to update the Physics library.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

 

Hi NOh

You can define the operator the way you prefer. For example:

with(Physics):

Setup(op = A)

`* Partial match of  'op' against keyword 'quantumoperators'`

 

[quantumoperators = {A}]

(1)

A := proc (K) options operator, arrow; if K::(specfunc(Ket)) and op(1, K) = A then f(op(2 .. -1, K)) else 'Typesetting:-delayDotProduct(A, K)' end if end proc:

These are the results you want:

A.Ket(A, a, b, c)

f(a, b, c)

(2)

Bra(A, a, b, c).Dagger(A)

conjugate(f(a, b, c))

(3)

A.Ket(B, a, b, c)

Parse:-ConvertTo1D, "invalid input %1", Typesetting:-mprintslash([A.Physics:-Ket(B, a, b, c)], [A.Physics:-Ket(B, a, b, c)])

(4)

In case you want something different for A . Ket(B,...), change the consequence after 'else'.

``


Download OperatorDotKet.mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Hi

Note you could use tensor notation, equivalent to what you have done but more compact, as in:

> Setup(AntiCommutator(Dgamma[mu], Dgamma[nu]) = 2*g_[mu, nu])

And it works as expected.

Having said that, there are two issues to be addressed, one is a weakness in the simplification of products of Dirac matrices, for example: Simplify(Dgamma[nu] Dgamma[alpha] Dgamma[alpha]) works but if Dgamma[nu] is in between the two contracted Dgamma[alpha] the algorithm quits prematurily and the simplification is not performed. The other issue is the one you mention, there is a typo in the mechanism to detect inconsistencies, it shouldn't interrupt as you show. I will be addressing these two things probably by the end of the month.

Edgardo S. Cheb-Terrab
Physics, Maplesoft

Hi

Given a PDE, or a system of them, there is already a command to compute the determining equations: PDEtools:-DeterminingPDE, and also to solve the system of determining equations returned by that command: pdsolve. Or do everything in one step, including using the output to compute invariant solutions: PDEtools:-InvariantSolutions.

Of course one can also do all the steps by hands, but in the case of the symmetry approach it would be rather cumbersome; it is simpler to use the existing code for that.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Hi
You can use Physics; understanding you are using Maple 18, please update your version of the Physics library from the Maplesoft R&D Physics page. You then have

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

First 45 46 47 48 49 50 51 Last Page 47 of 59