Items tagged with physics physics Tagged Items Feed

hi every one, i want to get derivative with sacalar function psi, first time ordinary derivative and second time covariant derivative , how should i write that ?!

hi every one ! i want to use Assume option to simplify some expression ! but it is not working ! what should i do !?

i have assume that ( a+b+c=0) and i want maple returns me exp(a+b+c) =1 ! but it does not ! what should i do !?


restart:with(Physics):

Assume(a+b+c=0):

about(a+b+c)

a+b+c:

  is assumed to be: 0

 

simplify(exp(a)*exp(b)*exp(c))

exp(a+b+c)

(1)

simplify(exp(a+b+c))

exp(a+b+c)

(2)

 


Download assume.mw

The presentation below is on undergrad Quantum Mechanics. Tackling this topic within a computer algebra worksheet in the way it's done below, however, is an exciting novelty and illustrates well the level of abstraction that is now possible using the Physics package.

 

Quantum Mechanics: Schrödinger vs Heisenberg picture

Pascal Szriftgiser1 and Edgardo S. Cheb-Terrab2 

(1) Laboratoire PhLAM, UMR CNRS 8523, Université Lille 1, F-59655, France

(2) Maplesoft

 

Within the Schrödinger picture of Quantum Mechanics, the time evolution of the state of a system, represented by a Ket "| psi(t) >", is determined by Schrödinger's equation:

I*`ℏ`*(diff(Ket(psi, t), t)) = H*Ket(psi, t)

where H, the Hamiltonian, as well as the quantum operators O__S representing observable quantities, are all time-independent.

 

Within the Heisenberg picture, a Ket Ket(psi, 0) representing the state of the system does not evolve with time, but the operators O__H(t)representing observable quantities, and through them the Hamiltonian H, do.

 

Problem: Departing from Schrödinger's equation,

  

a) Show that the expected value of a physical observable in Schrödinger's and Heisenberg's representations is the same, i.e. that

Bra(psi, t)*O__S*Ket(psi, t) = Bra(psi, 0)*O__H(t)*Ket(psi, 0)

  

b) Show that the evolution equation of an observable O__H in Heisenberg's picture, equivalent to Schrödinger's equation,  is given by:

diff(O__H(t), t) = (-I*Physics:-Commutator(O__H(t), H))*(1/`ℏ`)

where in the right-hand-side we see the commutator of O__H with the Hamiltonian of the system.

Solution: Let O__S and O__H respectively be operators representing one and the same observable quantity in Schrödinger's and Heisenberg's pictures, and H be the operator representing the Hamiltonian of a physical system. All of these operators are Hermitian. So we start by setting up the framework for this problem accordingly, including that the time t and Planck's constant are real. To automatically combine powers of the same base (happening frequently in what follows) we also set combinepowersofsamebase = true. The following input/output was obtained using the latest Physics update (Aug/31/2016) distributed on the Maplesoft R&D Physics webpage.

with(Physics):

Physics:-Setup(hermitianoperators = {H, O__H, O__S}, realobjects = {`ℏ`, t}, combinepowersofsamebase = true, mathematicalnotation = true)

[combinepowersofsamebase = true, hermitianoperators = {H, O__H, O__S}, mathematicalnotation = true, realobjects = {`ℏ`, t}]

(1)

Let's consider Schrödinger's equation

I*`ℏ`*(diff(Ket(psi, t), t)) = H*Ket(psi, t)

I*`ℏ`*(diff(Physics:-Ket(psi, t), t)) = Physics:-`*`(H, Physics:-Ket(psi, t))

(2)

Now, H is time-independent, so (2) can be formally solved: psi(t) is obtained from the solution psi(0) at time t = 0, as follows:

T := exp(-I*H*t/`ℏ`)

exp(-I*t*H/`ℏ`)

(3)

Ket(psi, t) = T*Ket(psi, 0)

Physics:-Ket(psi, t) = Physics:-`*`(exp(-I*t*H/`ℏ`), Physics:-Ket(psi, 0))

(4)

To check that (4) is a solution of (2), substitute it in (2):

eval(I*`ℏ`*(diff(Physics[Ket](psi, t), t)) = Physics[`*`](H, Physics[Ket](psi, t)), Physics[Ket](psi, t) = Physics[`*`](exp(-I*H*t/`ℏ`), Physics[Ket](psi, 0)))

Physics:-`*`(H, exp(-I*t*H/`ℏ`), Physics:-Ket(psi, 0)) = Physics:-`*`(H, exp(-I*t*H/`ℏ`), Physics:-Ket(psi, 0))

(5)

Next, to relate the Schrödinger and Heisenberg representations of an Hermitian operator O representing an observable physical quantity, recall that the value expected for this quantity at time t during a measurement is given by the mean value of the corresponding operator (i.e., bracketing it with the state of the system Ket(psi, t)).

So let O__S be an observable in the Schrödinger picture: its mean value is obtained by bracketing the operator with equation (4):

Dagger(Ket(psi, t) = Physics[`*`](exp(-I*H*t/`ℏ`), Ket(psi, 0)))*O__S*(Ket(psi, t) = Physics[`*`](exp(-I*H*t/`ℏ`), Ket(psi, 0)))

Physics:-`*`(Physics:-Bra(psi, t), O__S, Physics:-Ket(psi, t)) = Physics:-`*`(Physics:-Bra(psi, 0), exp(I*t*H/`ℏ`), O__S, exp(-I*t*H/`ℏ`), Physics:-Ket(psi, 0))

(6)

The composed operator within the bracket on the right-hand-side is the operator O in Heisenberg's picture, O__H(t)

Dagger(T)*O__S*T = O__H(t)

Physics:-`*`(exp(I*t*H/`ℏ`), O__S, exp(-I*t*H/`ℏ`)) = O__H(t)

(7)

Analogously, inverting this equation,

(T*(Physics[`*`](exp(I*H*t/`ℏ`), O__S, exp(-I*H*t/`ℏ`)) = O__H(t)))*Dagger(T)

O__S = Physics:-`*`(exp(-I*t*H/`ℏ`), O__H(t), exp(I*t*H/`ℏ`))

(8)

As an aside to the problem, we note from these two equations, and since the operator T = exp((-I*H*t)*(1/`ℏ`)) is unitary (because H is Hermitian), that the switch between Schrödinger's and Heisenberg's pictures is accomplished through a unitary transformation.

 

Inserting now this value of O__S from (8) in the right-hand-side of (6), we get the answer to item a)

lhs(Physics[`*`](Bra(psi, t), O__S, Ket(psi, t)) = Physics[`*`](Bra(psi, 0), exp(I*H*t/`ℏ`), O__S, exp(-I*H*t/`ℏ`), Ket(psi, 0))) = eval(rhs(Physics[`*`](Bra(psi, t), O__S, Ket(psi, t)) = Physics[`*`](Bra(psi, 0), exp(I*H*t/`ℏ`), O__S, exp(-I*H*t/`ℏ`), Ket(psi, 0))), O__S = Physics[`*`](exp(-I*H*t/`ℏ`), O__H(t), exp(I*H*t/`ℏ`)))

Physics:-`*`(Physics:-Bra(psi, t), O__S, Physics:-Ket(psi, t)) = Physics:-`*`(Physics:-Bra(psi, 0), O__H(t), Physics:-Ket(psi, 0))

(9)

where, on the left-hand-side, the Ket representing the state of the system is evolving with time (Schrödinger's picture), while on the the right-hand-side the Ket `ψ__0`is constant and it is O__H(t), the operator representing an observable physical quantity, that evolves with time (Heisenberg picture). As expected, both pictures result in the same expected value for the physical quantity represented by O.

 

To complete item b), the derivation of the evolution equation for O__H(t), we take the time derivative of the equation (7):

diff((rhs = lhs)(Physics[`*`](exp(I*H*t/`ℏ`), O__S, exp(-I*H*t/`ℏ`)) = O__H(t)), t)

diff(O__H(t), t) = I*Physics:-`*`(H, exp(I*t*H/`ℏ`), O__S, exp(-I*t*H/`ℏ`))/`ℏ`-I*Physics:-`*`(exp(I*t*H/`ℏ`), O__S, H, exp(-I*t*H/`ℏ`))/`ℏ`

(10)

To rewrite this equation in terms of the commutator  Physics:-Commutator(O__S, H), it suffices to re-order the product  H  exp(I*H*t/`ℏ`) placing the exponential first:

Library:-SortProducts(diff(O__H(t), t) = I*Physics[`*`](H, exp(I*H*t/`ℏ`), O__S, exp(-I*H*t/`ℏ`))/`ℏ`-I*Physics[`*`](exp(I*H*t/`ℏ`), O__S, H, exp(-I*H*t/`ℏ`))/`ℏ`, [exp(I*H*t/`ℏ`), H], usecommutator)

diff(O__H(t), t) = I*Physics:-`*`(exp(I*t*H/`ℏ`), H, O__S, exp(-I*t*H/`ℏ`))/`ℏ`-I*Physics:-`*`(exp(I*t*H/`ℏ`), Physics:-`*`(H, O__S)+Physics:-Commutator(O__S, H), exp(-I*t*H/`ℏ`))/`ℏ`

(11)

Normal(diff(O__H(t), t) = I*Physics[`*`](exp(I*H*t/`ℏ`), H, O__S, exp(-I*H*t/`ℏ`))/`ℏ`-I*Physics[`*`](exp(I*H*t/`ℏ`), Physics[`*`](H, O__S)+Physics[Commutator](O__S, H), exp(-I*H*t/`ℏ`))/`ℏ`)

diff(O__H(t), t) = -I*Physics:-`*`(exp(I*t*H/`ℏ`), Physics:-Commutator(O__S, H), exp(-I*t*H/`ℏ`))/`ℏ`

(12)

Finally, to express the right-hand-side in terms of  Physics:-Commutator(O__H(t), H) instead of Physics:-Commutator(O__S, H), we take the commutator of the equation (8) with the Hamiltonian

Commutator(O__S = Physics[`*`](exp(-I*H*t/`ℏ`), O__H(t), exp(I*H*t/`ℏ`)), H)

Physics:-Commutator(O__S, H) = Physics:-`*`(exp(-I*t*H/`ℏ`), Physics:-Commutator(O__H(t), H), exp(I*t*H/`ℏ`))

(13)

Combining these two expressions, we arrive at the expected result for b), the evolution equation of a given observable O__H in Heisenberg's picture

eval(diff(O__H(t), t) = -I*Physics[`*`](exp(I*H*t/`ℏ`), Physics[Commutator](O__S, H), exp(-I*H*t/`ℏ`))/`ℏ`, Physics[Commutator](O__S, H) = Physics[`*`](exp(-I*H*t/`ℏ`), Physics[Commutator](O__H(t), H), exp(I*H*t/`ℏ`)))

diff(O__H(t), t) = -I*Physics:-Commutator(O__H(t), H)/`ℏ`

(14)


Download:    Schrodinger_vs_Heisenberg_picture.mw     Schrodinger_vs_Heisenberg_picture.pdf

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

Hi,

In the following example I introduce some commutation rules that are standard in Quantum Mechanics. A major feature of the Maple Physics Package, is that it is possible to define tensors as Quantum Operators. This is of great interest because powerful tensor simplification rules can then be used in Quantum Mechanics. For an example, see the commutation rules of the components of the angular momentum operator in ?Physics,Examples. Here, I focus on a possible issue: when destroying all quantum operators, the pre-defined commutation rules still apply, which should not be the case. As shown in the post, this is link to the fact that these operators are also tensors.
 

NULL

 

Physics:-Version()[2]

`2016, August 16, 18:56 hours`

(1)

NULL

NULL

restart; with(Physics); interface(imaginaryunit = I)

First, set a 3D Euclidian space

Setup(mathematicalnotation = true, dimension = 3, signature = `+`, spacetimeindices = lowercaselatin, quiet)

[dimension = 3, mathematicalnotation = true, signature = `+ + +`, spacetimeindices = lowercaselatin]

(2)

Define two rank 1 tensors

Define(x[k], p[k])

`Defined objects with tensor properties`

 

{Physics:-Dgamma[a], Physics:-Psigma[a], Physics:-d_[a], Physics:-g_[a, b], p[k], x[k], Physics:-KroneckerDelta[a, b], Physics:-LeviCivita[a, b, c]}

(3)

Now, further define these tensors as quantum operators and gives the usual commutation rule between position and momentum operators (Quantum Mechanics).

Setup(hermitianoperators = {p, x}, algebrarules = {%Commutator(p[k], p[n]) = 0, %Commutator(x[k], p[l]) = I*`ℏ`*KroneckerDelta[k, l], %Commutator(x[k], x[l]) = 0}, realobjects = {`ℏ`})

[algebrarules = {%Commutator(p[k], p[n]) = 0, %Commutator(x[k], p[l]) = I*`ℏ`*Physics:-KroneckerDelta[k, l], %Commutator(x[k], x[l]) = 0}, hermitianoperators = {p, x}, realobjects = {`ℏ`}]

(4)

As expected:

(%Commutator = Commutator)(p[a], x[b])

%Commutator(p[a], x[b]) = -I*`ℏ`*Physics:-KroneckerDelta[a, b]

(5)

Now, reset all the Hermitian operators, so that all quantum operators are destroyed. This is useful if, for instance, one needs to compare some the result with the commutative case.

Setup(redo, hermitianoperators = {})

[hermitianoperators = none]

(6)

As expected, there are no quantum operators anymore...

Setup(quantumoperators)

[quantumoperators = {}]

(7)

...so that the following expressions should commute (result should be true)

Library:-Commute(p[a], x[b])

false

(8)

Result should be 0NULL

Commutator(p[a], x[b])

-I*`ℏ`*Physics:-KroneckerDelta[a, b]

(9)

p[a], x[b]

p[a], x[b]

(10)

NULL

NULL

``

NULLNULL

Below is just a copy & paste of the above section. The only difference, is that "Define(x[k], p[k])" has been commented, so that x[k]and p[k] are not a tensor. In that case, everything behaves as expected (but of course, the interesting feature of tensors is not available).

````

NULL

restart; with(Physics); interface(imaginaryunit = I)

First, set a 3D Euclidian space

Physics:-Setup(mathematicalnotation = true, dimension = 3, signature = `+`, spacetimeindices = lowercaselatin, quiet)

[dimension = 3, mathematicalnotation = true, signature = `+ + +`, spacetimeindices = lowercaselatin]

(11)

#Define two rank 1 tensors

Now, further define these tensors as quantum operators and gives the usual commutation rule between position and momentum operators (Quantum Mechanics)

Physics:-Setup(hermitianoperators = {p, x}, algebrarules = {%Commutator(p[k], p[n]) = 0, %Commutator(x[k], p[l]) = Physics:-`*`(Physics:-`*`(I, `ℏ`), Physics:-KroneckerDelta[k, l]), %Commutator(x[k], x[l]) = 0}, realobjects = {`ℏ`})

[algebrarules = {%Commutator(p[k], p[n]) = 0, %Commutator(x[k], p[l]) = I*`ℏ`*Physics:-KroneckerDelta[k, l], %Commutator(x[k], x[l]) = 0}, hermitianoperators = {p, x}, realobjects = {`ℏ`}]

(12)

As expected:

(%Commutator = Physics:-Commutator)(p[a], x[b])

%Commutator(p[a], x[b]) = -I*`ℏ`*Physics:-KroneckerDelta[a, b]

(13)

Now, reset all the Hermitian operators, so that all quantum operators are destroyed.

Physics:-Setup(redo, hermitianoperators = {})

[hermitianoperators = none]

(14)

As expected, there are no quantum operators anymore...

Physics:-Setup(quantumoperators)

[quantumoperators = {}]

(15)

...so that the following expressions should commute (result should be true)

Physics:-Library:-Commute(p[a], x[b])

true

(16)

Result should be 0``

Physics:-Commutator(p[a], x[b])

0

(17)

p[a], x[b]

p[a], x[b]

(18)

NULL

``

NULL``

NULL


Download Quantum_operator_as_Tensors_August_23_2016.mw

Dear all

Let q be  a real  different to one and for a fixed positive integer  n  given also 

 

Let x and y satisfies the condition

x*y -q*y*x=1

I will assume that the product is not commutative in all my computation

We would like to write the following function using only y

f(x,y)= x*y^n-q^n*y^n*x

 

all computation done I get f(x,y)=(q^n-1)/(q-1)*y^(n-1)

But how can I get the same result using Maple

Thank you very much for any help

 

 

 

 

 

Is there a maple routine or sequence of routines to minimize an energy functional (scalar energy with a function as an argument)?

I'd like to avoid applying calculus of variations/integration by parts by hand.

For example, I'm looking for something like:

E := int(diff(f(x),x)^2,x=0..1);
bc := f(0) = 0, f(1) = 1;
minimize(E,bc);

whose result would be:

       f(x) = x

Is there a way to use dsolve to do this?

Hi guys. I am new to the Maple environment.

Was trying to do some GR calculations when the following problem arose.

restart; with(Physics);
Setup(coordinates = (X = [t, r, theta, phi]), metric = -A(r)^2*(dt^2)+B(r)^2*(dr^2)+r^2*(dtheta^2)+r^2*(sin(theta)^2)*(dphi^2));
Setup(math = true);
g_[line_element]; g_[];
Christoffel[nonzero]; Christoffel[`~mu`, alpha, beta, nonzero];
D_[mu](g_[`~alpha`, `~beta`]);
expand(D_[2](g_[`~2`, `~beta`]));
D_[2](g_[`~2`, `~2`]);

The output for the last 3 lines are:

1. 0

2. Expansion in terms of Christoffel symbols (which does equal zero on substituting various values)

3. Non-zero value.

Obviously the answer must be zero for all cases (covariant derivative of metric). So what have I missed/misunderstood here?

Regards

BuddT

The following command works fine until you use it in the combination conjugate and diff.

example in Physics:

declare(phi(X));

diff(conjugate(phi(X)),x1);

phi(X) should now appear as phi with index x1 and a bar only, but

it comes as phi(X) x1 , the declare command is not effective. Non conjugate works fine.

Any idea - thanks in advance

Hi All, 

I'm using the Physics package, which enables GR calculations, ie defining metrics and tensor algebra. 

Was just curious if it were possible to add a perturbation to the metric when calculating Ricci and Christoffels. 

I would like something like 

g_[] = g1_[mu,nu] + h[mu,nu] 

And then do a calculation like, 

Ricci[]. 

 

I know this would be possible if I define everything and re-write the calculations for calculating Ricci, i.e

Define(g1[mu,nu], h[mu,nu]); 

and the proceed with GR calculations to find Ricci, however was hoping there was an easier way to do this. 

Any help is appreciated. 

Thanks guys. 

Hi,

 

I'm new to the physics package - wondering if i can tweak it a bit to look like things i'm used to:

 

is there a way to make Christoffel symbols print as upper case gamma, instead of  'G'?

KroneckerDelta print as lower case delta, instead of 'd'?

 

can i make the Schwarzschild metric look like it does in Hartle, Carroll, and others:

 

-(1 - 2M/r)dt^2 + (1-2M/r)^-1 + r^2(dtheta^2 + sin(theta)^2 dphi^2)

 

i know about setting the signature in Setup.

i have tried the 'Coordinates' command, but when i give it X=[t,r,theta,phi] i always seem to get back

[t,r,q,f]

 

i am running maple 2016

 

many thanks,

larry

 

Hi

 

I want to write the functional Z of J Z = exp(Int(Int(J(x)*Delta(x-y)*J(y), x), y))with Delta(x) = Int(I*exp(-I*k*x)*(1/(k^2-m^2)), k) in terms of the fourier transform of J: J(x) = Int(J(p)*exp(-I*p*x), p).

Actually I'm in Minkowski space and all the integrals should be over 4 dimensions, x,y,k,p should all be four-vectors, but I wanted to keep things short. (The only way I have found to express a 4D integral is using Physics-Intc with the singleparameters of the four vector. Is there a more convenient way to get d^4x?) But still in 1D I cannot solve it.

To find the solution, an exponential of only one integral, is actually pretty easy, since there are integrals over e. g. exp(-I*x*(p-k)) deliver a delta distribution, but I cannot reproduce this in Maple since he doesn't perform the integral over x.

I have found that I can/have to use the command inttrans-fourier to gain the delta distribution, but when I try to use it for the problem mentioned above I run into all kinds of problems. Not to mention that I cannot manage to perform a fourier transformation in 4D.

Does anybody know how to solve this problem? Thanks!

Hi all,

Using the Physics package, I have defined a density operator, shown in the image below:

Definition of Density Operator

(I did assume(s ≠i), assume(v≠h).

I then operate on it with the Bracket as shown in the next image:

Bracket on Density Operator

 

I think this should evaluate to (|Y,s,h><Y,s,h|)/2; or at least that's the result I want. However, Maple evaluates this to zero.

Is there a where to convince Maple to evaluate this to what I want/expect?

Thanks in advance,

Kevin

When the Physics package is loaded, Maple returns the following error in connection with the simple statement 2*D[1]:

Error, (in TypeTools/ac_var_local) unable to determine the anticommutative character of D[1]

Why that? Although to no avail, for D[1] there is no problem. Note that the above error results even without having set up any anticommutative prefixes or the likes in Physics Setup.

PS: I am using Maple 17.

I thought I'd try the latest version of the physics package. I am trying to look at a "simple" function with quantum operators, Taylor expand it, and write terms in normal order (i.e. Dagger(a) terms before a, and Dagger(b) before b), but am having no luck at all. Not sure if this is possible with the current version.

I am also having a couple of weird "interface issues" after loading the package:
1) See the printout from Setup() command - here Dagger(a) and Dagger(b) is sometimes displayed with a bar above the names, but other times (i.e. during other runs) with daggers.
2) Maple gets "stuck" on one of the lines - meaning I press enter, but it does not jump to the next execution block.

Both of these issues are outlined with "NOTE" in the worksheet.

Ultimately, the interface issues are of no concern to me, but I am pretty curious if the current version of the physics package can do what I need?

thanks

Worksheet:  commutator_stuff.mw

---------------------------------

 

 

greatings all,

I want to calculate energy momentum tensor for a given metric. is it possible to calculate it in the physics package?
thanks.

1 2 3 4 5 6 7 Last Page 1 of 13