# Starting Initial State as product state of singlets

+1 vote

Is there any way to construct the initial state so that it will be a product state of singlets??
For example if I have 2N sites I want N singlets to initialize the state.

Hi Dhiman,
Good question as this is an important thing to be able to do sometimes. And of course you can do this, yes, as one can set the elements of an ITensor or IQTensor individually so you can make any MPS this way.

Here is a sample code that makes an MPS which is a product state of singlets. To do the IQMPS version all you should need to do is change MPS to IQMPS and ITensor to IQTensor.

auto psi = MPS(sites);
for(int n = 1; n <= 2*N; n += 2)
{
auto s1 = sites(n);
auto s2 = sites(n+1);
auto wf = ITensor(s1,s2);
wf.set(s1(1),s2(2), ISqrt2);
wf.set(s1(2),s2(1), -ISqrt2);
ITensor D;
psi.Aref(n) = ITensor(s1);
psi.Aref(n+1) = ITensor(s2);
svd(wf,psi.Aref(n),D,psi.Aref(n+1));
psi.Aref(n) *= D;
}

commented by (150 points)
Thanks miles.