Quantum::ClebschGordan - Calculate/list Clebsch-Gordan Coefficients
Version 0.01
Calculate Clebsch-Gordan coefficients.
Commandline utility:
[davidrw@devbox davidrw]$ cg-j1j2 1 1/2
From perl:
use Quantum::ClebschGordan; print Quantum::ClebschGordan->new( j1=>1, j2=>'1/2', m=>'3/2', m1=>'1', m2=>'1/2', j=>'3/2' )->coeff; my $foo = Quantum::ClebschGordan->new(); ... printf "%6s %6s %6s %6s %6s %6s %6s, %s\n", Quantum::ClebschGordan->state_names, 'N', 'c'; printf "%6s %6s %6s %6s %6s %6s %6s, %s\n", $_->state_nums, $_->coeff, $_->coeff_value for Quantum::ClebschGordan->new( j1 => 1, j2 => '1/2' )->explode;
Some references:
Calculation of the coefficients: http://string.howard.edu/~tristan/QM2/QM2WE.pdf
Table of the coefficients: http://pdg.lbl.gov/2002/clebrpp.pdf
Wiki Page: http://en.wikipedia.org/wiki/Clebsch-Gordan_coefficients
Another table of the coefficients (warning--may be inaccurate): http://en.wikipedia.org/wiki/Table_of_Clebsch-Gordan_coefficients
http://wwwasdoc.web.cern.ch/wwwasdoc/shortwrupsdir/u111/top.html
http://bbs.sachina.pku.edu.cn/Stat/Math_World/math/w/w120.htm
Constructor -- can take named arguments of j1, j2, m, m1, m2, j
Returns the Clebsch-Gordan coefficient for the object's (j1,j2,m,m1,m2,j) values. undef unless all the values are set. NOTE: THIS IS NOT THE ACTUAL VALUE. It is in the notation +-N where N is non-negative integer or fraction, and the real value is +-sqrt(abs(N)). To get this directly, use the coeff_value method.
Returns the actual Clebsch-Gordan coefficient (as a real decimal number) for the object's (j1,j2,m,m1,m2,j) values. undef unless all the values are set. For an abbreviated notation, use the coeff method.
Returns the actual Wigner 3-j symbol for the object's (j1,j2,m,m1,m2,j) values. undef unless all the values are set. This is in the same notation as the coeff method.
Returns the actual Wigner 3-j symbol (as a real decimal number) for the object's (j1,j2,m,m1,m2,j) values. undef unless all the values are set. For an abbreviated notation, use the wigner3j method.
Use this method if you only have some of the (j1,j2,m,m1,m2,j) values;
Returns a list of Quantum::ClebschGordan objects based on the given (j1,j2,m,m1,m2,j) values for the current object. If any of those values are unset, then there will be an object in the list for each of the possible combinations, given the rules governing m and j values. Each of the returned Quantum::ClebschGordan objects will have all of the (j1,j2,m,m1,m2,j) values set, and thus the coeff, coeff_value, wigner3j, and wigner3j_value will all have values.
Returns the list of names of the state variables -- based on a constant and will return ('j1', 'j2', 'm', 'm1', 'm2', 'j').
Returns the list of the (j1,j2,m,m1,m2,j) values as Number::Fraction objects.
Returns the list of the (j1,j2,m,m1,m2,j) values as real decimal values.
Overload of Class::Accessor's set() method. Same functionality, plus the following if setting on of the 'state' variables:
Attempts to converts the value into a Number::Fraction object. This allows for values such as '1/2' to be used.
Performs validation (via __check_state()) that this new value is consistent w/the other state values.
Attempts to auto-calculate the coefficient (only succeeds if all vars are set; otherwise coeff is cleared).
Attempts to calculate the Clebsch-Gordan coffectient for the object and sets the __coeff attribute (which is what the coeff and coeff_value methods are based upon).
Audits the (j1,j2,m,m1,m2,j) values to make sure that they are valid and consistent with each other. Returns undef (and throws a warning) if there is an error. Returns 1 if all values are set and valid. Returns -1 if only some of the values are set, but the ones that are set are valid.
Quick & dirty helper function that's bascially like the unix 'seq' command.
Returns n! for a given integer n. Uses Memoize for caching.
Converts a value from the form returned by coeff to a real number.
Attempts to convert a real number in the form returned by coeff.
David Westbrook, <dwestbrook at gmail.com>
<dwestbrook at gmail.com>
Quantum::ClebschGordan requires the following modules:
Number::Fraction
Memoize
Class::Accessor
Carp
Please report any bugs or feature requests to bug-quantum-clebschgordan at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Quantum-ClebschGordan. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-quantum-clebschgordan at rt.cpan.org
I'm also available by email or via '/msg davidrw' on <http://perlmonks.org>.
You can find documentation for this module with the perldoc command.
perldoc Quantum::ClebschGordan
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Quantum-ClebschGordan
CPAN Ratings
http://cpanratings.perl.org/d/Quantum-ClebschGordan
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Quantum-ClebschGordan
Search CPAN
http://search.cpan.org/dist/Quantum-ClebschGordan
Copyright 2006 David Westbrook, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Quantum::ClebschGordan, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Quantum::ClebschGordan
CPAN shell
perl -MCPAN -e shell install Quantum::ClebschGordan
For more information on module installation, please visit the detailed CPAN module installation guide.