Attaching persistent assumptions to symbol definition
If you don't want to use $Assumptions
you may set the assumptions to a variable:
dom = And @@ (# > 0 &) /@ {λ, w, R, r} && -π < θ <= π
(* λ > 0 && w > 0 && R > 0 && r > 0 && -π < θ <= π *)
Then call (Full)Simplify with these assumptions:
Abs[v[0, 0, λ, w, R, 0, 0, r, θ]]^2 // Simplify[#, dom] &
giving: 1/π
The TransformationFunctions
option for Simplify
and FullSimplify
allows you to create custom simplification manipulations that can be used either in place of or in addition to the defaults. Combined with SetOptions
this can allow special handling of certain expressions by Simplify
and/or FullSimplify
.
My proposal is elementary, and I am not answering your question in the form it has been asked. However, did you not think about custom assumptions or custom Simplify
? For example, in your case let us fix the assumptions:
assume = (And @@ (# > 0 && # ∈ Reals & /@ {λ, w, R, r, θ})) ~ And ~
(r > 0 && r ∈ Reals && -π < θ <= π && θ ∈ Reals);
and make a custom Simplify
:
mySimp[expr_] := Simplify[expr, assume];
Now with your function:
u[p_, m_, λ_, w_, R_, ψ_, ψ0_, r_, θ_] :=
Sqrt[(2 p!)/((1 + DiscreteDelta[0, m]) π (m + p)!)]
Exp[I (2 p + m + 1) (ψ - ψ0)]/w
((Sqrt[2] r)/w)^m LaguerreL[p, m, (2 r^2)/w^2]
Exp[-I (2 π)/λ r^2/2 (1/R - I λ/(π w^2)) + I m θ]
Let us simplify:
Abs[u[0, 0, λ, w, R, 0, 0, r, θ]]^2 // mySimp
(* => 1/π *)
This will work during the whole session. In a new session you need to only once execute a cell with this (and analogous) definition.
It seems me to be better than to attach the assumption to any variable. If I would attach a restriction to a variable, in 5 minutes I would need to use this variable outside of the just attached restriction :).