No BSD License
-
GUI(varargin)
-
buildconvtbl_c( Jmax )
BUILDCONVTBL_C generates J from Jmax and M from J
-
buildconvtbl_r( j1, j2 )
BUILDCONVTBL_R contains j1, j2 to M conversion info
-
calcallcgcoef( j1, j2 )
CALCCGCOEF : calculate clebisch-gordon coefficients
-
cgcoeff_stage2( J, init_rhs_i...
-
coef_jminus( j, m )
JMINUS coefficient of jminus
-
coef_jplus( j, m )
JMINUS coefficient of jminus
-
disprecord( alhs, arhs, coeff...
DISPRECORD outputs the inner product notation and coefficients
-
findinitindex( j1, j2, M )
FINDINITINDEX find a rhs indices which is non-zero
-
findrecord( M, r )
FINDINDEX: find indices which matches the row
-
locateindex( M, m)
ISELEMENTUNIQUE checks if matrix is unique defined by tuple of 4 elements
-
op_jminus( parent_i, parent_c...
OP_JMINUS for a given parent, create children based on opjminus.
-
op_jplus( parent_i, parent_c )
OP_JPLUS for a given parent, create children based on opjminus.
-
record2str( alhs, arhs, coeff...
RECORD2STR Summary of this function goes here
-
searchbycol( M, col )
SEARCHBYCOL find a row in a matrix. Matrix must be two dimension
-
searchbyrow( M, row )
SEARCHROW find a row in a matrix. Matrix must be two dimension
-
solveinitcoef( init_i )
SOLVEINITCOEF initial indices and coefficients
-
CH3Q6c.m
-
GUI_MAIN.m
-
GUI_UPDATERADIOS.m
-
TEST_SSCANF.m
-
View all files
from
Clebsch Gordan Coefficient Solver GUI
by james jun
Easy to use Clebsch-Gordan coefficient solver for adding two angular momentums.
|
| solveinitcoef( init_i ) |
function [ init_c ] = solveinitcoef( init_i )
%SOLVEINITCOEF initial indices and coefficients
[numtuple temp] = size(init_i); %there are as many numtuples as num var
if (numtuple == 1)
init_c = sym(1);
return;
end
init_c = sym(zeros([1 numtuple]));
for i = 1:numtuple
init_c(i) = sym(['x' num2str(i)]);
end
curr_rhs_i = sym([]);
curr_rhs_c = sym([]);
for c=1:numtuple
[children_i children_c] = op_jplus(init_i(c,:), init_c(c));
for ichild=1:numel(children_c)
achild_i = children_i(ichild,:);
achild_c = children_c(ichild);
iloc = locateindex(curr_rhs_i, achild_i);
if (iloc == 0)
curr_rhs_i(end+1,:) = achild_i;
curr_rhs_c(end+1) = achild_c;
else
curr_rhs_c(iloc) = curr_rhs_c(iloc) + achild_c;
end
end
end
expr = 'solve(';
for i=1:numel(curr_rhs_c)
expr = [expr 'curr_rhs_c(' num2str(i) '), '];
end
%build x1^2 + x2^2 + x3^2 + x4^2 ... -1
ALLSQR = [];
for i=1:numtuple
ALLSQR = [ALLSQR 'x' num2str(i) '^2'];
if (i ~= numtuple);
ALLSQR = [ALLSQR ' + '];
end
end
ALLSQR = [ALLSQR ' -1'];
expr = [expr '''' ALLSQR '''' ];
expr = [expr ');'];
%solve
answer = eval(expr);
for i=1:numtuple
temp = getfield(answer, ['x' num2str(i)]);
init_c(i) = temp(1);
end
|
|
Contact us at files@mathworks.com