1
$\begingroup$

I am working with Poisson brackets of Angular momentum, and I want Mathematica to be able to return the angular momentum function if the Poisson bracket yields that result. I.e. provided

PoissonBracket[a_ , b_] := 
  Module[{position, momentum}, 
    position = {x, y, z};
    momentum = {px, py, pz};
    result = 
      D[a, {position}].D[b, {momentum}] - D[a, {momentum}].D[b, {position}]]

FLx[x_, y_, z_, px_, py_, pz_] := y*pz - z*py;
Lx = FLx[x, y, z, px, py, pz];
FLy[x_, y_, z_, px_, py_, pz_] := z*px - x*pz;
Ly = FLy[x, y, z, px, py, pz];
FLz[x_, y_, z_, px_, py_, pz_] := x*py - y*px;
Lz = FLz[x, y, z, px, py, pz];

(I did this to be able to compute actual values later on and to take Jacobians in an easier way)

If I compute

PoissonBracket[Lx, Ly] 

I get pz y - py z, but I want to get Lz straight away instead. I have tried using simplify with assumptions in various ways, but

FullSimplify[PoissonBracket[Ly, Lz], Lx]

returns True

 FullSimplify[PoissonBracket[Ly, Lz], Lx == pz y - py z]

returns pz y - py z, so it does nothing.

What am I doing wrong?

$\endgroup$

1 Answer 1

1
$\begingroup$
Clear["Global`*"]

PoissonBracket[a_, b_] := Module[{position, momentum}, position = {x, y, z};
  momentum = {px, py, pz};
  result = 
   D[a, {position}].D[b, {momentum}] - D[a, {momentum}].D[b, {position}]]

FLx[x_, y_, z_, px_, py_, pz_] := y*pz - z*py;
FLy[x_, y_, z_, px_, py_, pz_] := z*px - x*pz;
FLz[x_, y_, z_, px_, py_, pz_] := x*py - y*px;

If you Set (=) the values of Lx, Ly, and Lz then these can never appear in a result since they will always be evaluated to their Set values. Perhaps you want replacement rules.

rules = {FLx[x, y, z, px, py, pz] -> Lx,
  FLy[x, y, z, px, py, pz] -> Ly,
  FLz[x, y, z, px, py, pz] -> Lz}

(* {pz y - py z -> Lx, -pz x + px z -> -pz x + px z, py x - px y -> Lz} *)

PoissonBracket[FLx[x, y, z, px, py, pz], FLy[x, y, z, px, py, pz]] /. rules

{* Lz *)
$\endgroup$
2
  • $\begingroup$ Thank you loads! Is there any way to avoid writing the FLx[x, y, z, px, py, pz], i.e. just FLx to take derivatives or any more compact notation? $\endgroup$ Nov 14, 2020 at 18:08
  • $\begingroup$ flx = FLx[x, y, z, px, py, pz]; Then use flx $\endgroup$
    – Bob Hanlon
    Nov 14, 2020 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.