Coder Social home page Coder Social logo

chatcannon / wignersymbols Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joeydumont/wignersymbols

0.0 2.0 0.0 79 KB

A C++ library to compute the Wigner 3j- and 6j- symbols (with FORTRAN backend).

License: GNU Lesser General Public License v3.0

CMake 1.72% C 0.46% C++ 32.41% Fortran 65.41%

wignersymbols's Introduction

Wigner Symbols

Build status Code coverage report Join the chat at https://gitter.im/valandil/wignerSymbols DOI

A C++ ensemble of functions to compute the Wigner 3j- and 6j- symbols. It reimplements the algorithm designed by Schulten and Gordon in C++, but also contains the original Fortran implementation. It can act either as a complete C++ replacement to the original Fortran implementation, or a C++ interface to them. See the API docs for details. It can either compute an array of Wigner 3j or 6j symbols, or a single coefficient. It also computes the Clebsch-Gordan coefficients.

Note that there is a third party Python wrapper available on GitHub.

Compilation Instructions

This library uses CMake to help the build process. First, download the source code. It is recommended to create a separate directory for building, i.e.

mkdir build/
cd build/

Then, run

cmake .. && make && sudo make install

By default, the library is installed to /usr/lib/ and the include files are in /usr/include/. To install to another directory, say /usr/local/, use the command-line argument

cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local && make && sudo make install

API documentation

We list the user-facing functions that compute the Wigner symbols. The functions are behind the namespace WignerSymbols. Both the C++ implementation (my own) and the original Fortran implementation (by Schulten and Gordon) are provided by this package. In my own tests, I had found that the original Fortran implementation provided only single precision. This might be compiler-dependent, so you might have better luck. The Fortran version is also somewhat faster (10% faster, approximately). In any case, this program provides either a complete C++ replacement, or a C++ interface to the evaluation of Wigner symbols.

C++ implementation

  • std::vector<double> wigner3j(double l2, double l3, double m1, double m2, double m3)
    Computes Wigner 3j symbols with all possible values of l1. Returns an std::vector<double> with the coefficients sorted by increasing values of l1.
  • double wigner3j(double l1, double l2, double l3, double m1, double m2, double m3)
    Computes a specific Wigner 3j symbol.
  • double clebschGordan(double l1, double l2, double l3, double m1, double m2, double m3)
    Computes a specific Clebch-Gordan coeffcient.
  • std::vector<double> wigner6j(double l2, double l3, double l4, double l5, double l6)
    Computes Wigner 6j symbols with all possible values of l1. Returns an std::vector<double> with the coefficients sorted by increasing values of l1.
  • double wigner6j(double l1, double l2, double l3, double l4, double l5, double l6)
    Computes a specific Wigner 6j symbol.

Fortran implementation

  • std::vector<double> wigner3j_f(double l2, double l3, double m1, double m2, double m3)
    Computes Wigner 3j symbols with all possible values of l1.
  • double wigner3j_f(double l1, double l2, double l3, double m1, double m2, double m3)
    Computes a specific Wigner 3j symbol.
  • double clebschGordan_f(double l1, double l2, double l3, double m1, double m2, double m3)
    Computes a specific Clebch-Gordan coeffcient.
  • std::vector<double> wigner6j_f(double l2, double l3, double l4, double l5, double l6)
    Computes Wigner 6j symbols with all possible values of l1.
  • double wigner6j_f(double l1, double l2, double l3, double l4, double l5, double l6)
    Computes a specific Wigner 6j symbol.

Bibliography

  • K. Schulten and R. G. Gordon, Recursive evaluation of 3j and 6j coefficients, Comput. Phys. Commun. 11, 269โ€“278 (1976). DOI: 10.1016/0010-4655(76)90058-8
  • K. Schulten, Exact recursive evaluation of 3j- and 6j-coefficients for quantum-mechanical coupling of angular momenta, J. Math. Phys. 16, 1961 (1975). DOI: 10.1063/1.522426.
  • J. Luscombe and M. Luban, Simplified recursive algorithm for Wigner 3j and 6j symbols, Phys. Rev. E 57, 7274โ€“7277 (1998). DOI: 10.1103/PhysRevE.57.7274.

wignersymbols's People

Contributors

chatcannon avatar gitter-badger avatar hmenke avatar joeydumont avatar seweber avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.