DickeModel.EnergyShellProjections

For examples of usage, go to Examples for EnergyShellProjections.

Integrals of arbitrary functions

DickeModel.EnergyShellProjections.∫∫dqdpδϵFunction
function ∫∫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

Keyword arguments

  • ϵ is a real number corresponding to $\epsilon$ above.
  • Q and P are the $Q$ and $P$ coordinates of $\mathbf{x}$ above.
  • f should be function with signature f([Q,q,P,p]) that returns values that may be added together (e.g. numbers, arrays, etc...).
  • p_res is the resolution of the integral. The amount of nodes for the quadrature will be equal to 2*floor(p₊/p_res) + 1, where p₊ is defined below Eq. (9) of Ref. [14]. Default is 0.01.
  • nonvalue is the value to return if $Q,P$ are outside of the energy shell at $\epsilon$. Default is NaN.
  • onlyqroot may be +, -, or nothing (default). If it is + (-), the integral is only computed over the positive (negative) roots in q, that is, only the $q_+$ ($q_-$) term is taken in Eq. (8) of Ref. [14]. If it is nothing, both terms are added.
source
DickeModel.EnergyShellProjections.matrix_QP∫∫dqdpδϵFunction
function 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

Keyword arguments

  • ϵ is a real number (see arguments for ∫∫dqdpδϵ).
  • f should be function with signature f([Q,q,P,p]) that returns values that may be added together (e.g. numbers, arrays, etc...).
  • res determines the separation between the elements of Qs and Ps. It also determines p_res in 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 symmetricQP is true, only the non-positive entries of Q and P will be computed, and the other entries will be mirrored. Default is false.
  • If symmetricP is true, only the side with non-positive P coordinate will be comptued, and the other entries will be mirrored. The default is to be the same that symmetricQP.
  • parallelize indicates whether to use all available workers. Defaults to true if this function is called from worker 1, and false else.
  • show_progress turns the progress bar on/off. Default is true.
  • pbatch_size is the maximum number of batches to run in a single run in a single worker. The default value is automatically optimized depending on res and the number of workers.
  • kargs... are redirected to ∫∫dqdpδϵ.
source
DickeModel.EnergyShellProjections.energy_shell_averageFunction
function 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

Keyword arguments

  • ϵ is a real number
  • f should be function with signature f([Q,q,P,p]) that returns values that may be added together (e.g. numbers, arrays, etc...).
  • res determines the separation between the elements of Qs and Ps. It also determines p_res in 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 symmetricQP is true, only the non-positive entries of Q and P will be computed, and the other entries will be mirrored. Default is false.
  • If symmetricP is true, only the side with non-positive P coordinate will be comptued, and the other entries will be mirrored. The default is to be the same that symmetricQP.
source

Integrals of Husimi functions

DickeModel.EnergyShellProjections.rényi_occupation_and_proj_husimi_QP_matrixFunction
function 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

  • system should be an instance of DickeBCE.QuantumDickeSystem.
  • states may 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, and husimi_of_coherent is used.

Keyword arguments

  • ϵ, Q, and P (which are $\epsilon$, $Q$, and $P$ above) have to be passed.
  • chop is passed to DickeBCE.coherent_overlap.
  • res determines the resolution of the integral, as in matrix_QP∫∫dqdpδϵ.
  • nonvalue is the value to return if $Q,P$ are outside of the energy shell at $\epsilon$. Default is NaN.
  • mix_states switches the behaviour if states is a matrix. If false (default), a result is returned for each state. If true, the Husimis are first passed to mix_function, and the result is integrated.
  • mix_function – when mix_states is true, this function is evaluated with the resulting Husimis mix_function([Qstate1,Qstate2, ...]) before manipulating them. Each number Qstatei corresponds to the Husimi function of the ith column of states. The default function is mean, which is equivalent to treating the matrix states as a mixed state with equal weights. Custom weights could be used by passing mix_function([Qstate1,Qstate2, ...]) = p1*Qstate1 + p2*Qstate2 + .... Moreover, mix_function may return a vector: for example, mix_function([Qstate1,Qstate2, ...]) = [Qstate1, (Qstate1 + Qstate2)/2] would compute Ls and matrices for two states: first for state1, and second the mixed state composed of half state1 and half state2. 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 occupations Ls. Defaults to 2.
  • matrix_powers may be a number or an array, determining the orders of the moments in the projections matrices. matrix_powers should be a subset of α ∪ {1}. Defaults to 1.
  • kargs are redirected to matrix_QP∫∫dqdpδϵ
source