DickeModel.EnergyShellProjections
For examples of usage, go to Examples for EnergyShellProjections.
Integrals of arbitrary functions
DickeModel.EnergyShellProjections.∫∫dqdpδϵ — Functionfunction ∫∫dqdpδϵ(system::DickeSystem;
ϵ::Real,
Q::Real,
P::Real,
f::Function,
p_res::Real=0.01,
nonvalue=nothing,
onlyqroot::Union{typeof(-),typeof(+),Nothing}=nothing)Computes the integral
\[ \int \int \text{d}q \text{d}p f(\mathbf{x}) \delta(h_\text{cl}(\mathbf{x}) - \epsilon)\]
using Eq. (8) of Ref. [14] and a Chebyshev–Gauss quadrature method.
Note: to type ∫ in Julia, type \int + Tab.
Arguments
systemshould be an instance ofClassicalDicke.DickeSystem.
Keyword arguments
ϵis a real number corresponding to $\epsilon$ above.QandPare the $Q$ and $P$ coordinates of $\mathbf{x}$ above.fshould be function with signaturef([Q,q,P,p])that returns values that may be added together (e.g. numbers, arrays, etc...).p_resis the resolution of the integral. The amount of nodes for the quadrature will be equal to2*floor(p₊/p_res) + 1, wherep₊is defined below Eq. (9) of Ref. [14]. Default is0.01.nonvalueis the value to return if $Q,P$ are outside of the energy shell at $\epsilon$. Default isNaN.onlyqrootmay be+,-, ornothing(default). If it is+(-), the integral is only computed over the positive (negative) roots inq, that is, only the $q_+$ ($q_-$) term is taken in Eq. (8) of Ref. [14]. If it isnothing, both terms are added.
DickeModel.EnergyShellProjections.matrix_QP∫∫dqdpδϵ — Functionfunction matrix_QP∫∫dqdpδϵ(system::DickeSystem;
f::Function,
ϵ::Real,
res::Real=0.1,
symmetricQP::Bool=false,
symmetricP::Bool=symmetricQP,
parallelize::Bool=(Distributed.myid()==1),
show_progress::Bool = true,
pbatch_size::Integer=Int(min(ceil((4/res)^2/Distributed.nprocs()/10),50)))Returns a tuple (Qs, Ps, mat) where Qs and Ps are real vectors spanning all possible values of $P$ and $Q$ with some step res, and mat is a matrix whose entries are given by mat[i,j] =∫∫dqdpδϵ(system; kargs..., ϵ=ϵ, Q=Qs[i], P=P[j], p_res=res)
Arguments
systemshould be an instance ofClassicalDicke.DickeSystem.
Keyword arguments
ϵis a real number (see arguments for∫∫dqdpδϵ).fshould be function with signaturef([Q,q,P,p])that returns values that may be added together (e.g. numbers, arrays, etc...).resdetermines the separation between the elements ofQsandPs. It also determinesp_resin the calls to∫∫dqdpδϵ. It should be a positive real number that is an integer fraction of 2 (i.e. $2/n$ for some $n \in \mathbb{N}$). Computation time is inversely proportional to the cube of this quantity.- If
symmetricQPistrue, only the non-positive entries ofQandPwill be computed, and the other entries will be mirrored. Default isfalse. - If
symmetricPistrue, only the side with non-positivePcoordinate will be comptued, and the other entries will be mirrored. The default is to be the same thatsymmetricQP. parallelizeindicates whether to use all available workers. Defaults totrueif this function is called from worker1, andfalseelse.show_progressturns the progress bar on/off. Default istrue.pbatch_sizeis the maximum number of batches to run in a single run in a single worker. The default value is automatically optimized depending onresand the number of workers.kargs...are redirected to∫∫dqdpδϵ.
DickeModel.EnergyShellProjections.energy_shell_average — Functionfunction energy_shell_average(system::DickeSystem;
ϵ::Real,
f::Function,
res::Real=0.01,
symmetricQP::Bool=false,
symmetricP::Bool=symmetricQ)Returns the energy shell average
\[\frac{j^2}{(2\pi)^2\nu(\epsilon)}\int_{\mathcal{M}}\!\!\text{d}\mathbf{x}\, \delta(h_\text{cl}(\mathbf{x})-\epsilon) f(\mathbf{x})\]
of f([Q,q,P,p]).
Arguments
systemshould be an instance ofClassicalDicke.DickeSystem.
Keyword arguments
ϵis a real numberfshould be function with signaturef([Q,q,P,p])that returns values that may be added together (e.g. numbers, arrays, etc...).resdetermines the separation between the elements ofQsandPs. It also determinesp_resin the calls to∫∫dqdpδϵ. It should be a positive real number that is an integer fraction of 2 (i.e. $2/n$ for some $n \in \mathbb{N}$). Computation time is inversely proportional to the cube of this quantity.- If
symmetricQPistrue, only the non-positive entries ofQandPwill be computed, and the other entries will be mirrored. Default isfalse. - If
symmetricPistrue, only the side with non-positivePcoordinate will be comptued, and the other entries will be mirrored. The default is to be the same thatsymmetricQP.
Integrals of Husimi functions
DickeModel.EnergyShellProjections.rényi_occupation_and_proj_husimi_QP_matrix — Functionfunction rényi_occupation_and_proj_husimi_QP_matrix(system::DickeBCE.QuantumDickeSystem,
states::AbstractVecOrMat{<:Number};
res::Real,
chop::Real=1e-4,
nonvalue=NaN,
mix_states::Bool=false,
mix_function::Function=mean,
α::Union{AbstractArray{<:Real,1},Real}=2,
matrix_powers::Union{AbstractArray{<:Real,1},Real}=1,
kargs...)Returns a tuple (Ls,(Qs,Ps,matrices)) where Ls contains the Rényi occupations given by Eq. (30) of Ref. [20], and matrices contains the values of the projections
\[ \iint \text{d} q\text{d} p \,\delta(h_\text{cl}(Q,q,P,p)-\epsilon)\, \mathcal{Q}_{\psi}(Q,q,P,p)^\alpha,\]
where $\mathcal{Q}_{\psi}(\mathbf{x}) = \left | \left \langle \mathbf{x} \middle | \psi \right \rangle \right |^2$ is the Husimi function of state $\left | \psi \right \rangle$, for each $Q$ in Qs and $P$ in Ps. The values $\alpha$ in α (which may be a vector or a number) determine the order of the Rényi occupations, and matrix_powers determine the powers of the projections.
Arguments
systemshould be an instance ofDickeBCE.QuantumDickeSystem.statesmay be a vector (single state) or a matrix of multiple states as columns. The states are assummed to be in the efficient coherent basis. In the special case that the length of the states is 4, they are instead assumed to be the coordinates[Q,q,P,p]of a coherent state, andhusimi_of_coherentis used.
Keyword arguments
ϵ,Q, andP(which are $\epsilon$, $Q$, and $P$ above) have to be passed.chopis passed toDickeBCE.coherent_overlap.resdetermines the resolution of the integral, as inmatrix_QP∫∫dqdpδϵ.nonvalueis the value to return if $Q,P$ are outside of the energy shell at $\epsilon$. Default isNaN.mix_statesswitches the behaviour ifstatesis a matrix. Iffalse(default), a result is returned for each state. Iftrue, the Husimis are first passed tomix_function, and the result is integrated.mix_function– whenmix_statesistrue, this function is evaluated with the resulting Husimismix_function([Qstate1,Qstate2, ...])before manipulating them. Each numberQstateicorresponds to the Husimi function of theith column ofstates. The default function ismean, which is equivalent to treating the matrixstatesas a mixed state with equal weights. Custom weights could be used by passingmix_function([Qstate1,Qstate2, ...]) = p1*Qstate1 + p2*Qstate2 + .... Moreover,mix_functionmay return a vector: for example,mix_function([Qstate1,Qstate2, ...]) = [Qstate1, (Qstate1 + Qstate2)/2]would computeLsandmatricesfor two states: first forstate1, and second the mixed state composed of halfstate1and halfstate2. This allows to compute several quantities in one run. Another example,mix_function(hus) = [hus; mean(hus)]will compute all the individual states, along with the equally-weighted mixed state.αmay be a number or an array, determining the orders of the Rényi occupationsLs. Defaults to2.matrix_powersmay be a number or an array, determining the orders of the moments in the projections matrices.matrix_powersshould be a subset ofα ∪ {1}. Defaults to1.kargsare redirected tomatrix_QP∫∫dqdpδϵ
DickeModel.EnergyShellProjections.rényi_occupation — Functionfunction rényi_occupationReturns only the Rényi occupations Ls in rényi_occupation_and_proj_husimi_QP_matrix, same arguments apply, although matrix_powers is ignored.
DickeModel.EnergyShellProjections.proj_husimi_QP_matrix — Functionfunction proj_husimi_QP_matrixReturns only the projection matrices (Qs,Ps,matrices) in rényi_occupation_and_proj_husimi_QP_matrix, same arguments apply, although α should not be passed.