kron_groups_simple (Calls: 1, Time: 19.452 s)
Generated 20-Jul-2018 02:24:57 using performance time.
function in file C:\Users\yz\Dropbox\Workspace\Researches\PhD Research\My Papers\2018_symmtry_reduction\18groupsymmetrySDPSlaterHaoRenata.d\codesgroupsymmetrySDPSlaterHaoRenata.d\qap\sub-routines\kron_groups_simple.m
Copy to new window for comparing multiple runs
Function Name | Function Type | Calls |
LiveEditorEvaluationHelperESectionEval | script | 1 |
Line Number | Code | Calls | Total Time | % Time | Time Plot |
39 | basis{k+p*q} = [0 v'; zeros(n^... | 4062 | 18.613 s | 95.7% | |
38 | basis{k} = blkdiag(0,M); | 4062 | 0.453 s | 2.3% | |
34 | M = kron(basis1{i},basis2{j}); | 4062 | 0.275 s | 1.4% | |
40 | basis{k+2*p*q} = basis{k+p*q}'... | 4062 | 0.047 s | 0.2% | |
35 | v = diag(M); | 4062 | 0.039 s | 0.2% | |
All other lines | 0.025 s | 0.1% | |||
Totals | 19.452 s | 100% |
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
blkdiag | function | 4063 | 0.433 s | 2.2% | |
kron | function | 4062 | 0.226 s | 1.2% | |
kron_groups_simple>@(X)sparse(X) | anonymous function | 683 | 0.004 s | 0.0% | |
Self time (built-ins, overhead, etc.) | 18.789 s | 96.6% | |||
Totals | 19.452 s | 100% |
Line number | Message |
Total lines in function | 52 |
Non-code lines (comments, blank lines) | 29 |
Code lines (lines that can run) | 23 |
Code lines that did run | 23 |
Code lines that did not run | 0 |
Coverage (did run/can run) | 100.00 % |
time | Calls | line | |
---|---|---|---|
1 | function basis = kron_groups_simple(G1,G2) | ||
2 | |||
3 | % no symmetrization version | ||
4 | |||
5 | % if Gi is the automorphism group of the matrix Ai for i = 1,2 | ||
6 | % then G is the automorphism group of the matrix kron(A1,A2) | ||
7 | |||
8 | % get the basis for kron(G1,G2) and the orthogonal matrix Q | ||
< 0.001 | 1 | 9 | basis1 = G1.basis; |
< 0.001 | 1 | 10 | basis2 = G2.basis; |
11 | % make the basis matrix into sparse matrix | ||
0.001 | 1 | 12 | basis1 = cellfun(@(X) sparse(X), basis1, 'uniformoutput', false); |
0.008 | 1 | 13 | basis2 = cellfun(@(X) sparse(X), basis2, 'uniformoutput', false); |
14 | |||
15 | % get the sizes of the groups and the matrices | ||
< 0.001 | 1 | 16 | p = length(basis1); |
1 | 17 | q = length(basis2); | |
< 0.001 | 1 | 18 | n = length(basis1{1}); |
19 | |||
20 | % initialize | ||
< 0.001 | 1 | 21 | basis = cell(3*p*q+1,1); |
22 | |||
23 | % the first one | ||
0.010 | 1 | 24 | basis{1} = blkdiag(1,zeros(n^2)); |
25 | |||
1 | 26 | k = 1; | |
27 | % k2 = 0; | ||
< 0.001 | 1 | 28 | for i = 1:p |
< 0.001 | 6 | 29 | for j = 1:q |
30 | % for each basis B1 and B2 | ||
0.001 | 4062 | 31 | k = k + 1; |
32 | |||
33 | % make kron(A,B) and its diagonal | ||
0.275 | 4062 | 34 | M = kron(basis1{i},basis2{j}); |
0.039 | 4062 | 35 | v = diag(M); |
36 | |||
37 | % construct the basis | ||
0.453 | 4062 | 38 | basis{k} = blkdiag(0,M); |
18.613 | 4062 | 39 | basis{k+p*q} = [0 v'; zeros(n^2,n^2+1)]; |
0.047 | 4062 | 40 | basis{k+2*p*q} = basis{k+p*q}'; |
41 | |||
42 | % if norm(basis_copy{k}-basis{k})>0 | ||
43 | % keyboard | ||
44 | % end | ||
0.002 | 4062 | 45 | end |
< 0.001 | 6 | 46 | end |
47 | |||
48 | |||
49 | % print the information | ||
1 | 50 | nr_basis = length(basis); | |
< 0.001 | 1 | 51 | fprintf('the orbit size is %d \n',nr_basis) |
< 0.001 | 1 | 52 | end |
Other subfunctions in this file are not included in this listing.