-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Utility functions for bosonic states #340
Comments
Hi @labay11, Thank you for suggesting new features. I like the idea of avoiding to define the bosonic operators when computing the coherence of the state, by directly iterating over the elements of the array. There are a few comments about the functions you defined. Perhaps it is better to change the name of the Then, I would include the options to also choose for which subsystem we want to compute the mean occupation or the coherence. Immagine to have many bosons, and I only want to compute the coherence of the second one only, or the third and the fourth. The definition of your x = sum(R) do j
j_tuple = Tuple(j) .- 1
J = dot(j_tuple, off) + 1
abs2(ψ[J]) * prod(j_tuple)
end and also the other implementations. Overall, I think this is a good idea. Do you want to contribute with a Pull Request? |
Does If it does, we can make the function name same as theirs. |
@albertomercurio I like the idea of being able to calculate the mean value in just one subsystem. Also the name @ytdHuang I think it is not implemented in QuTiP. |
Problem Description
Define and correct some utility functions to get the mean photon number and coherence for bosonic systems.
In arithmetic_and_attributes.jl there is already a defined function to get the coherence for a quantum state. However, the current implementation is only valid for single systems. For composite systems the function computes an annihilation operator which is the product over all the dimensions, such definition is not correct as the total annihilation operator should be the kronecker product of
a
in each subsysems.Proposed Solution
Here are some functions I use to calculate the mean photon number without the need to construct the operator. This is particularly faster for density matrix as you can skip the matrix product.
In the case of the
get_coherent
functions I would propose to divide into two functions:get_coherence
which returnsexpect(a, *)
andremove_coherence
which returns the state withD' * ψ
applied.Similarly to the
mpn
functions I proposed,get_coherence
can also be extended to multiple subsystems.Alternate Solutions
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: