Observables¶
Generated from the docstrings in the source code.
expectation
¶
coefficients
¶
momentum
¶
current
¶
Probability current and angular momentum, with derivatives evaluated spectrally (exact for band-limited wavefunctions on the periodic grid).
gradient(psi: np.ndarray, grid)
¶
Spectral gradient (∂ψ/∂x, ∂ψ/∂y, ∂ψ/∂z) truncated to the grid dimension.
probability_current(wf, hbar: float = 1.0, m: float = 1.0)
¶
Probability current density j = (ℏ/m) Im(ψ* ∇ψ), returned as a tuple of arrays (j_x[, j_y[, j_z]]). It satisfies ∂|ψ|²/∂t + ∇·j = 0.
Source code in quantumlab/observables/current.py
angular_momentum_z_expectation(wf, hbar: float = 1.0) -> float
¶
⟨L_z⟩ = ⟨ψ| −iℏ (x ∂_y − y ∂_x) |ψ⟩ for 2D and 3D wavefunctions.
Source code in quantumlab/observables/current.py
autocorrelation(psi0, psi_t, grid) -> complex
¶
C(t) = ⟨ψ(0)|ψ(t)⟩. Its Fourier transform peaks at the eigenenergies.
vortex_positions(wf, min_density: float = 0.2, smoothing: float = 1.0)
¶
Quantised vortices of a 2D wavefunction from the phase winding around each grid plaquette, ∮∇φ·dl = 2πq.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min_density
|
float
|
Only plaquettes where the smoothed density exceeds this fraction of its maximum are kept. This removes the "ghost" phase singularities in the dilute region outside the condensate. |
0.2
|
smoothing
|
float
|
Gaussian smoothing length (physical units) used for that density mask; it should exceed the core size so the cores themselves are not masked. |
1.0
|
Returns:
| Name | Type | Description |
|---|---|---|
positions |
(ndarray, shape(n, 2))
|
(x, y) of the plaquette centres containing a vortex. |
charges |
(ndarray, shape(n))
|
Winding numbers q (±1 for singly quantised vortices). |
Source code in quantumlab/observables/current.py
nonlinear
¶
interaction_energy(wf, nonlinearity: float) -> float
¶
Mean-field interaction energy E_int = (g/2) ∫ |ψ|⁴ dV.
gross_pitaevskii_energy(wf, potential, nonlinearity: float, hbar: float = 1.0, m: float = 1.0) -> float
¶
GP energy functional E[ψ] = ⟨T⟩ + ⟨V⟩ + (g/2)∫|ψ|⁴ (conserved by real-time GPE dynamics).
Source code in quantumlab/observables/nonlinear.py
chemical_potential(wf, potential, nonlinearity: float, hbar: float = 1.0, m: float = 1.0) -> float
¶
μ = ⟨T⟩ + ⟨V⟩ + g∫|ψ|⁴, the eigenvalue of the stationary GP equation.
Source code in quantumlab/observables/nonlinear.py
coupled_gp_energy(states, potentials, couplings, hbar: float = 1.0, m: float = 1.0) -> float
¶
Energy functional of a multi-component condensate, E = Σ_i (⟨T⟩_i + ⟨V_i⟩) + ½ Σ_ij g_ij ∫ n_i n_j dV, with n_i = |ψ_i|².
Source code in quantumlab/observables/nonlinear.py
miscibility_overlap(wf_a, wf_b) -> float
¶
Spatial overlap Λ = ∫ n_a n_b / sqrt(∫ n_a² ∫ n_b²) of two components: 1 for identical density profiles, → 0 for fully separated ones.