Learn to Use ITensor

main / classes / customspin


The CustomSpin class is a specialization of SiteSet which initializes its sites to be of type CustomSpinSite, representing a spin with total spin quantum number S (= 1/2, 1, 3/2, 2, ...) where the user can specify S.

CustomSpin and CustomSpinSite are defined in the file "itensor/mps/sites/customspin.h"


auto sh_sites = CustomSpin(100,{"S=",0.5}); //100 S=1/2 sites
auto S+_3 = op(sh_sites,"S+",3);          //obtain "S+" operator

auto s3h_sites = CustomSpin(100,{"2S=",3}); //100 S=3/2 sites
auto Sz_7 = op(s3h_sites,"Sz",7);          //obtain "Sz" operator

Named Arguments Recognized

The CustomSpin class accepts the following named arguments. Only one of these needs to be provided:

Operators Provided by CustomSpinSite

Back to Classes
Back to Main