Self-consistent field (SCF)#

gala.scf contains utilities for evaluating basis function expansions of mass densities and gravitational potentials with the Self-Consistent Field (SCF) method of Hernquist & Ostriker (1992; [HO92]). SCF uses Hernquist radial functions and spherical harmonics for angular functions. This implementation is based on the formalism described in the original paper but using the notation of Lowing et al. (2011; [L11]).

Introduction#

The two main ways to use gala.potential.scf are:

  1. to compute the expansion coefficients given a continuous density distribution or discrete samples from a density distribution, then

  2. to evaluate the density, potential, and gradients of a basis function expansion representation of a density distribution given this set of coefficients.

To compute expansion coefficients, the relevant functions are compute_coeffs and compute_coeffs_discrete. This implementation uses the notation from [L11]: all expansion coefficients are real, \(S_{nlm}\) are the cosine coefficients, and \(T_{nlm}\) are the sine coefficients.

Once you have coefficients, there are two ways to evaluate properties of the potential or the density of the expansion representation. gala provides a class-based interface SCFPotential that utilizes the gravitational potential machinery implemented in gala.potential (and supports all of the standard potential functionality, such as orbit integration and plotting). The examples below use this interface.

Examples#

API#

gala.potential.scf Package#

Implementation of the Self-Consistent Field (SCF) expansion method.

Functions#

compute_coeffs(density_func, nmax, lmax, M, r_s)

Compute the expansion coefficients for representing the input density function using a basis function expansion.

compute_coeffs_discrete(xyz, mass, nmax, ...)

Compute the expansion coefficients for representing the density distribution of input points as a basis function expansion.

Classes#

SCFInterpolatedPotential(m, r_s, Sjnlm, ...)

A gravitational potential represented as a basis function expansion with the Hernquist basis, but where the coefficients are interpolated with linear interpolation to compute the density, potential, or acceleration at a given time.

SCFPotential(m, r_s, Snlm, Tnlm[, units, ...])

A gravitational potential represented as a basis function expansion.

Class Inheritance Diagram#

digraph inheritanceeacbb745e5 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "CPotentialBase" [URL="../api/gala.potential.potential.CPotentialBase.html#gala.potential.potential.CPotentialBase",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A baseclass for defining gravitational potentials implemented in C."]; "PotentialBase" -> "CPotentialBase" [arrowsize=0.5,style="setlinewidth(0.5)"]; "CommonBase" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "PotentialBase" [URL="../api/gala.potential.potential.PotentialBase.html#gala.potential.potential.PotentialBase",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A baseclass for defining pure-Python gravitational potentials."]; "CommonBase" -> "PotentialBase" [arrowsize=0.5,style="setlinewidth(0.5)"]; "SCFInterpolatedPotential" [URL="../api/gala.potential.scf.SCFInterpolatedPotential.html#gala.potential.scf.SCFInterpolatedPotential",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="SCFInterpolatedPotential(m, r_s, Sjnlm, Tjnlm, tj, com_xj, com_vj, units=None, origin=None, R=None)"]; "CPotentialBase" -> "SCFInterpolatedPotential" [arrowsize=0.5,style="setlinewidth(0.5)"]; "SCFPotential" [URL="../api/gala.potential.scf.SCFPotential.html#gala.potential.scf.SCFPotential",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="SCFPotential(m, r_s, Snlm, Tnlm, units=None, origin=None, R=None)"]; "CPotentialBase" -> "SCFPotential" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

References#