Skip to content

Commit

Permalink
Improved README
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanze Wu committed Nov 5, 2020
1 parent 8e468c3 commit 2681296
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 19 deletions.
44 changes: 28 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,49 @@

# Scatter2

Perform 2D multistate scattering calculation in a Cartesian grid basis.
Thie is an implementation of quantum scattering calculation in two dimension system in a Cartesian grid basis. The basic algorithm can be found in [J. Chem. Phys. **142**, 084110 (2015)](http://dx.doi.org/10.1063/1.4908032) and [J. Phys. Chem. A 2020 **124** (37), 7355-7372](http://dx.doi.org/10.1021/acs.jpca.0c04562). Please cite the two papers if you have used the code.


## Installation

Requirements:
- Armadillo > 9.500.2
- C++11 supported compiler (ideally C++14)
- OpenMP support
- Python3
- Armadillo > 9.500.2: Which can be found in [http://arma.sourceforge.net](http://arma.sourceforge.net).
- CXXOPT library: Which can be found in [https://github.com/jarro2783/cxxopts](https://github.com/jarro2783/cxxopts). Put cxxopts.hpp in the project root directory.
- A compiler supporting C++11 and OpenMP.

To install, run (takes less than 1 min)
To build the code, run (should takes less than 1 min)

make

## Usage

The argument list can be found by specifying `--help`.
Arguments available to the code:

File "linearpot.hpp" and "angularpot.hpp" contains various potential classes available for simulation. You may create your own classes of potential in these two files, which will automatically appear in the choices of "--potential" if properly set.
- N: Number of the grid;
- Ny: Number of the grid in the y direction (by default = N);
- dx: Spacing of the grid;
- n_stencil: Differential stencil used for the kinetic matrix. It is half of the actual stencil used, e.g. n_stencil=2 indicates a 3-stencil, n_stencil=3 indicates a 5-stencil, etc.
- n_ext: Extra grid for the boundary wave basis. By default is 3. Usually set to = n_stencil;
- n_bs: Limit of bound state used. Default is 1.
- in_bs: Incoming bound state. Default is 0.
- in_el: Incoming electronic state.
- L: Length of the model in x direction. In atomic units.
- m: Nuclear mass.
- E: Overall incoming energy (including potential energy).
- startpos: Incident position. Either "up" or "down". For angular potentials, specifying "up" indicates incoming from left.
- potential: Name of the potential used. Can be the return of `get_name()` of any potential included in the [angularpot.hpp](angularpot.hpp) and [linearpot.hpp](linearpot.hpp). To repeat our published work, only "2statelx" and "angular" are needed.
- param: Params for the model Hamiltonian. The format can be found in the example.
- output: The suffix of the output.

## Example

[example/bifurcation.sh](example/bifurcation.sh) generates the raw data for Fig.1 in [this paper](https://arxiv.org/abs/2008.02443). It may be modified to a PBS script.
The argument list can also be found by specifying `--help`.

## Citation
Running the program will give three outputs:

If you use this code, please consider citing
- prob-[suffix]: Describes the (normalized) scattering probabilities for each bound states and (unnormalized) scattering amplitudes for each bound states.
- bound-[suffix]: The wavefunction of bound states, in a grid basis.
- state-[suffix]: The wavefunction solution. Will output as a (N x Nel) row and N column matrix. The number in (a*N + i)'th row and j'th column indicates the wavefunction value at electronic state |a> and nuclear position (i, j).

[1] [Yanze Wu, Gaohan Miao, and Joseph E. Subotnik. The Journal of Physical Chemistry A 2020 124 (37), 7355-7372](http://dx.doi.org/10.1021/acs.jpca.0c04562);

Feel free to contact us if you have any questions.
## Example

[example/bifurcation.sh](example/bifurcation.sh) generates the two-dimensional scattering result in a bifurcation Hamiltonian described in [this paper](https://arxiv.org/abs/2008.02443). It should be able to run directly if the program is correctly built.

16 changes: 14 additions & 2 deletions example/bifurcation.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@

# Parameters you may specify:
# E: Incoming energy
# A, eps, epsc, r, omega: Parameter of potential
# A, mu, lambda, eps, epsc, r, omega: Parameter of potential

A=0.02
mu=0.0002
lambda=0.001
eps=2.5
epsc=2.5
r=2
omega=0.01
E=0.007 # This is just one point. To repeat full Fig.1 you need to iterate E from 0.006 to 0.06.

# Requires a single core and 6.2 MB memory. Takes several minutes.

# Put scatter into your environment, or just move the script to project root.

scatter -N 128 -L 8 --n_stencil=5 --n_ext=5 -m 1000 -E $E --in_el=0 --n_bs=20 --potential 2statelx --startpos down --output up-E$E --param $A,$mu,$lambda,$eps,$epsc,$omega,$r,1000,10 > out-E$E.txt

# Will output three files:
# Will output four files:
# out-*: STDOUT;
# prob-*: Probability file. Describes the (normalized) scattering probability in each bound states and (unnormalized) scattering amplitude in each bound states.
# bound-*: Wavefunction of bound states.
# state-*: Wavefunction of the solution.

2 changes: 1 addition & 1 deletion scatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <array>
#include <string>
#include <numeric>
#include "external/cxxopts.hpp"
#include "cxxopts.hpp"
#include "printmat.hpp"

#include "potential.h"
Expand Down

0 comments on commit 2681296

Please sign in to comment.