Hi Matt,

we don't currently support operators acting on more than two sites. This will need an extension of the library and codes, which is planned but has not been done yet. A 16-spin operator for calculating S^2 will be horrible, by tghe way - there are usually better ways of getting S^2 than measuring it directly. If you tell us what you need to measure we might be able to find out the best way of doing it.

Matthias

On 3 Feb 2012, at 20:43, Stone, Matthew B. wrote:

Matthias, et al.,
 
Could you please post how to code this for one, two, three and four spins?  From there I should be able to extend it out to N spins.  I’ll likely be working with N<=16.
 
Thanks,

Matt Stone
 
 
>For many spins you need to code each number of spins separately, but it gets ugly pretty soon.
> 
>Matthias
> 
>>On 24 Jan 2012, at 19:36, Stone, Matthew B. wrote:
>> 
>> Has anyone written an ALPS operator for the operator S^2 for a general number of spins in a system?
>> 
>> For example, I would like to list the Sztotal and S^2 values for different energy levels calculated.
>>  
>> The S^2 operator can be written as
>> S^2 = (S_1 + S_2 + S_3 +?)^2
>> where S_1, S_2, etc. are the vector operators.
>> 
>> for two spins one can write this as
>> S^2 = (S_1 + S_2)^2
>>       =    (S_1)^2 +  (S_2)^2 + 2 S_1 \dot S_2
>>        = s(s+1) + s(s+1) + 2S_{1z}S_{2z} + S_{1+}S_{2-} + S_{1-}S_{2+}
>> 
>> But I don?t see how to generalize this for a system of many spins
>> using the ALPS ?spin? sitebasis and basis in order to have this operator value listed in the output calculations.
>> 
>> Any help would be appreciated.
>> Thanks,
>> 
>> Matthew B. Stone
>> Neutron Scattering Science Division
>> Oak Ridge National Laboratory
>> PO box 2008 MS6475
>> Oak Ridge, TN 37831-6475
>> 
>> Phone: 1-865-202-6898
>> Fax: 1-865-574-6080
>>