https://github.com/ashtonsbradley/quantumfluidspectra.jl
Fast, accurate, and flexible spectral analysis for compressible quantum fluids
https://github.com/ashtonsbradley/quantumfluidspectra.jl
correlations julia quantum-fluids spectral-analysis
Last synced: 8 months ago
JSON representation
Fast, accurate, and flexible spectral analysis for compressible quantum fluids
- Host: GitHub
- URL: https://github.com/ashtonsbradley/quantumfluidspectra.jl
- Owner: AshtonSBradley
- License: mit
- Created: 2021-11-02T01:50:55.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-09-17T09:56:55.000Z (9 months ago)
- Last Synced: 2025-09-17T11:41:57.987Z (9 months ago)
- Topics: correlations, julia, quantum-fluids, spectral-analysis
- Language: Julia
- Homepage:
- Size: 5.24 MB
- Stars: 4
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Citation: citation.bib
Awesome Lists containing this project
README
# QuantumFluidSpectra.jl
[](https://github.com/AshtonSBradley/QuantumFluidSpectra.jl/actions)
[](https://codecov.io/gh/AshtonSBradley/QuantumFluidSpectra.jl)
This package provides methods to calculate energy spectra of compressible quantum fluids described by a wavefunction, including dilute-gas Bose-Einstein condensates, polariton BEC, and quantum fluids of light.
Fast, accurate, and flexible spectral analysis provides a wealth of information about nonlinear quantum fluid dynamics.
We rely on Fourier spectral methods throughout. The user provides a wavefunction and minimal information about the spatial domain.
## Install
```julia
julia> ]add QuantumFluidSpectra
```
The setup is described below.
Create Field
```julia
# Create arrays including `x` and `k` grids
n = 100
L = (1,1)
N = (n,n)
X,K,dX,dK = xk_arrays(L,N) # setup domain
```
```julia
# make a test field
ktest = K[1][2] # pick one of the `k` values
ψ = @. exp(im*ktest*X[1]*one.(X[2]'))
psi = Psi(ψ,X,K) # make field object with required arrays.
```
Power spectra and correlations
To evaluate the incompressible power spectral density on a particular k grid:
```julia
k = LinRange(0.05,10,300) # can be anything
εki = incompressible_spectrum(k,psi)
```
The (angle-averaged) two-point correlator of the incompressible velocity field may then be calculated by
```
r = LinRange(0,10,300) # can be anything
gi = gv(r,k,εki) # pass k vals on which εki is defined
```
See the citation below for details.
## Example: central vortex in a 2D Bose-Einstein condensate
For creation script, see `/example_figure/test_2Dtrap_vortex.jl`.

to reproduce Figure 3(a) of [https://arxiv.org/abs/2112.04012](https://arxiv.org/abs/2112.04012}).
# Citation
If you use `QuantumFluidSpectra.jl` please cite the paper
```bib
@article{PhysRevA.106.043322,
title = {Spectral analysis for compressible quantum fluids},
author = {Bradley, Ashton S. and Kumar, R. Kishor and Pal, Sukla and Yu, Xiaoquan},
journal = {Phys. Rev. A},
volume = {106},
issue = {4},
pages = {043322},
numpages = {15},
year = {2022},
month = {Oct},
publisher = {American Physical Society},
doi = {10.1103/PhysRevA.106.043322},
url = {https://link.aps.org/doi/10.1103/PhysRevA.106.043322}
}
```