# Overview

Atlassian Sourcetree is a free Git and Mercurial client for Windows.

Atlassian Sourcetree is a free Git and Mercurial client for Mac.

# DVR Basis compared with HO Basis

This project contains the source and accompanying code for the paper A. Bulgac and M. M. Forbes, "Use of the Discrete Variable Representation Basis in Nuclear Physics", Phys. Rev. C 87, 051301(R) (2013)) [arXiv:1301.7354], providing a concrete realization of the topic discussed and explicit code for generating the figures.

The code DVR_Demo.py comes from an IPython notebook can be viewed using the IPython Notebook Viewer.

## View the DVR_Demo Notebook

The project depends only on fairly standard IPython, NumPy, SciPy, SymPy, and matplotlib components that can be easily installed using the Enthough Python Distribution (EPD) or Anaconda, though fairly recent versions are needed to work with the notebook (in particular, IPython version 0.13.1). The actual plots for the paper were generated using plots.py which depends on some custom tools (for setting up fonts, grids etc.) in my pymmf package.

### Triton and Alpha Particles

The directory python contains Python code for using DVR bases for a brute force solution to the few-body problem for three- and four-particle states with simple attractive S-wave interaction. We apply a DVR basis to the relative Jacobi coordinates to find the three-body ("triton") and four-body ("alpha particle") bound states. This code requires a few more components to function efficiently – in particular, numexpr and anfft which wraps the FFTW. (The code should still run, albeit more slowly, if these are not installed.)

The directory matlab contains similar code in MATLAB.

Using these codes, one can find the lowest energy states using a simple Lanczos iteration with lattices of up to \(18\times 18\times 18\) for the "triton" and \(8\times 8 \times 8\) for the "alpha particle". These correspond to wavefunctions with \(18^6\approx 10^8\) and \(8^9\approx 10^8\) components (1GB per wavefunction) respectively, requiring about 12GB of RAM, and can be solved in less than an hour on a modern laptop. (A more careful implementation caching matrices on disk and using an in-place FFT could extend these to about \(10^9\) components.) This is a fairly straightforward implementation: we have not attempted to use any special features – such a symmetries of the ground state – to reduce the size of the basis.

The python code is organized into the following files:

`shell_model.py`:- The main code defining the units, problem, Hamiltonian etc.
`dvr.py`:- Various 1D DVR basis sets including Dirichlet and Sinc bases.
`bases.py`:- Provides full basis sets for the few-body problem constructed from the DVR
and Fourier bases. Also defines the
`RelCoord`class which specifies the appropriate transformations for converting relative Jacobi coordinates to absolute coordinates for the three- and four-body systems. `solvers.py`:- Code for the Lanczos solver that finds the lowest few states of the Hamiltonian. Note: this is a simple implementation that does not implement re-orthogonalization schemes (to save memory) but works sufficiently well for the problems considered here.
`utils.py`:- Tries to implement numexpr and anfft, warning the user about potential performance problems if these are not provided.
`figures.py`:- Some code for automating the generation of energies used in the paper.