choreo.NBodySyst#

class NBodySyst(Py_ssize_t geodim=2, Py_ssize_t nbody=2, double[::1] bodymass=None, double[::1] bodycharge=None, list Sym_list=[], inter_law=None, unicode inter_law_str=None, inter_law_param_dict=None, bool ForceGeneralSym=False, bool ForceGreaterNStore=False)#

This class defines a N-body system

Class Constructor

__init__()

Defines a N-Body System.

See also

Parameters:
  • geodim (int, optional) – Number of dimensions of ambiant space. Typically 2 or 3, but can be any positive integer. By default: 2.

  • nbody (int, optional) – Number of bodies in the system, by default 2.

  • bodymass (numpy.ndarray(shape = (nbody), dtype = np.float64), optional) – Masses of the bodies in the system, by default numpy.ones.

  • bodycharge (numpy.ndarray(shape = (nbody), dtype = np.float64), optional) – Charges of the bodies, by default numpy.ones.

  • Sym_list (list, optional) – List of a priori symmetries in the system, by default [].

  • inter_law (optional) – Function defining the interaction law, by default None.

  • inter_law_str (str, optional) – Description of the interaction law dictating the dynamics of the system, by default None.

  • inter_law_param_dict (dict, optional) – Parameters pertaining to the interaction law, by default None.

  • ForceGeneralSym (bool, optional) – Whether to force the symmetries to be treated in full generality when computing positions or velocities from parameters (and vice-versa, both in direct or adjoint mode), or to try an optimized route instead. Most users should leave this option to its default value, which is False.

  • ForceGreaterNStore (bool, optional) – Whether to force the number of stored segment positions to be increased, even though the symmetries might not require it. Most users should leave this option to its default value, which is False.

Methods Summary

AssertAllBodyConstraintAreRespected

AssertAllSegmGenConstraintsAreRespected

BuildSegmGraph

ChooseInterSegm

ChooseLoopGen

ComputeCenterOfMass

ComputeSymDefault

Compute_forces

Compute_forces_nosym

Compute_forces_vectorized

Compute_forces_vectorized_nosym

Compute_grad_forces

Compute_grad_forces_nosym

Compute_grad_forces_vectorized

Compute_grad_forces_vectorized_nosym

Compute_grad_velocities

Compute_grad_velocities_vectorized

Compute_init_pos_mom

Compute_initial_constraint_default_pos

Compute_initial_constraint_default_vel

Compute_n_sub_fft

Compute_periodicity_default_pos

Compute_periodicity_default_vel

Compute_velocities

Compute_velocities_vectorized

ConfigureShortcutSym

DescribeSystem

DetectEscape

DetectLoops

DetectSegmRequiresDisp

DetectXlim

Detect_homo_inter_law

FromDict

FromSolutionFile

GatherInterSym

GetFullAABB

GetKrylovJacobian

Get_ODE_def

Get_segmpos_minmax

Init_to_dict

Make_params_bounds

PlotTimeBodyGraph

Segmpos_Descriptor

Set_inter_law

Sets the interaction law of the system.

TT_params_to_action_grad

Profiles the computation of the gradient of the action with respect to parameters.

TestActionSame

TestHashSame

Update_ODE_params

Validate_inter_law

Write_Descriptor

__init__

Defines a N-Body System.

all_coeffs_dense_to_params_noopt

all_coeffs_pos_to_vel_inplace

all_coeffs_to_kin_nrg

all_coeffs_to_kin_nrg_grad

all_coeffs_to_params_noopt

all_pos_to_all_body_pos_noopt

all_to_segm_noopt

allocate_owned_memory

Allocates the buffer arrays used in NBodySyst depending on the value of nint and fft_backend.

co_in

free_owned_memory

Frees the memory allocated for the buffer arrays used in NBodySyst.

nnz_k

params_basis_pos

params_basis_vel

params_changevar

params_resize

params_to_action

params_to_action_grad

_summary_

params_to_action_hess

params_to_all_coeffs_dense_noopt

params_to_all_coeffs_noopt

params_to_kin_nrg

params_to_kin_nrg_grad

params_to_pot_nrg

params_to_pot_nrg_grad

params_to_pot_nrg_hess

params_to_segmpos

params_to_segmvel

plot_segmpos_2D

Plots 2D trajectories with one color per body and saves image in file

pos_slice

segm_to_path_stats

segmpos_dparams_to_action_hess

segmpos_params_to_action

segmpos_params_to_action_grad

segmpos_to_all_noopt

segmpos_to_allbody_noopt

segmpos_to_hash

segmpos_to_params

segmpos_to_params_T

Attributes

ALG_Iint

ALG_SpaceRot

ALG_TimeRev

BinProdChargeSum

BinSourceSegm

BinSpaceRot

BinSpaceRotIsId

BinTargetSegm

BodyGraph

ForceGeneralSym

ForceGreaterNStore

bool Whether to force the rightmost integration point to be included in segments.

GreaterNStore

bool Whether the rightmost integration point is included in segments.

Hash_exp

Homo_exp

Homo_unit

InitValPosBasis

InitValVelBasis

InterSpaceRot

InterSpaceRotIsId

InterTimeRev

LawIsHomo

LoopGenConstraints

ParamBasisShortcutPos

ParamBasisShortcutVel

PerDefBeg_Isegm

PerDefBeg_SpaceRotPos

PerDefBeg_SpaceRotVel

PerDefBeg_TimeRev

PerDefEnd_Isegm

PerDefEnd_SpaceRotPos

PerDefEnd_SpaceRotVel

PerDefEnd_TimeRev

RequiresGreaterNStore

bool Whether the symmetry constraints require the rightmost integration point to be included in segments.

SegmGraph

SegmRequiresDisp

Sym_list

Targets

bodyloop

bodysegm

fft_backend

str Name of the FFT backend currently in use.

fftw_nthreads

object

fftw_planner_effort

object

fftw_wisdom_only

'bool'

gensegm_loop_start

gensegm_to_all

gensegm_to_body

gensegm_to_iint

gensegm_to_iintrel

geodim

int Dimension of ambient space.

ifft_shapes

inter_law_param_dict

inter_law_str

str A description of the interaction law

intersegm_to_all

intersegm_to_body

intersegm_to_iint

loopcharge

loopgen

loopmass

loopnb

n_sub_fft

nbin_segm_tot

int Total number of binary interactions between segments.

nbin_segm_unique

int Number of unique binary interactions between segments.

nbody

int Number of bodies in system.

ncoeff_min_loop

ncoeffs

int Number of Fourier coefficients in each loop.

ngensegm_loop

nint

int The number of integration points per period.

nint_fac

int Half the size of a segment.

nint_min

int Minimum number of integration points per period.

nloop

int Number of loops in system.

nparams

int Number of parameters.

nparams_incl_o

int Number of parameters after removal of unnecessary parts of zero-indexed Fourier coefficients.

nrem

nsegm

int Number of segments in system.

params_shapes

params_shifts

pos_slice_shapes

segm_size

int Number of interacting positions in a segment.

segm_store

int Number of stored positions in a segment.