This is a static copy of a profile report

Home

Function details for kron_groups_simpleThis is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
LiveEditorEvaluationHelperESectionEvalscript1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
39
basis{k+p*q} = [0 v'; zeros(n^...
406218.613 s95.7%
38
basis{k} = blkdiag(0,M);
40620.453 s2.3%
34
M = kron(basis1{i},basis2{j});
40620.275 s1.4%
40
basis{k+2*p*q} = basis{k+p*q}'...
40620.047 s0.2%
35
v = diag(M);
40620.039 s0.2%
All other lines  0.025 s0.1%
Totals  19.452 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
blkdiagfunction40630.433 s2.2%
kronfunction40620.226 s1.2%
kron_groups_simple>@(X)sparse(X)anonymous function6830.004 s0.0%
Self time (built-ins, overhead, etc.)  18.789 s96.6%
Totals  19.452 s100% 
Code Analyzer results
Line numberMessage
Coverage results
Show coverage for parent directory
Total lines in function52
Non-code lines (comments, blank lines)29
Code lines (lines that can run)23
Code lines that did run23
Code lines that did not run0
Coverage (did run/can run)100.00 %
Function listing
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.