Tensor Network Theory Library  Beta release 1.2.1
A library of routines for performing TNT-based operations
 All Data Structures Functions Variables Groups Pages
tntMatExpandBasis.m
1 %======================================================================
2 %> @ingroup matscripts
3 %> Expands a matrix representing an operator for a single species into a matrix representing a multi-species operator
4 %>
5 %> Returns the result in a cell having a number of elements equal to the number of species.
6 %> If the original operator was \f$d\times d\f$, the new matrices will be \f$d^N\times d^N\f$.
7 %>
8 %> @param ssop Single species operator
9 %> @param N The number of species
10 %>
11 %> @retval exop Cell array containing the operator for each species
12 %======================================================================
13 function ex_op = tntMatExpandBasis(ssop, N)
14 
15 d = size(ssop,1);
16 
17 ex_op = cell(N,1);
18 
19 for n = 1:N
20  ex_op{n} = kron(kron(eye(d^(n-1)),ssop),eye(d^(N-n)));
21 end
22 
23 end
function tntMatExpandBasis(in ssop, in N)