spin_half_species

  • full name: tenpy.networks.site.spin_half_species

  • parent module: tenpy.networks.site

  • type: function

tenpy.networks.site.spin_half_species(SpeciesSite, cons_N, cons_Sz, **kwargs)[source]

Initialize two FermionSite to represent spin-1/2 species.

You can use this directly in the tenpy.models.model.CouplingMPOModel.init_sites(), e.g., as in the tenpy.models.hubbard.FermiHubbardModel2.init_sites():

cons_N = model_params.get('cons_N', 'N')
cons_Sz = model_params.get('cons_Sz', 'Sz')
return spin_half_species(FermionSite, cons_N=cons_N, cons_Sz=cons_Sz)
Parameters:
  • SpeciesSite (Site | str) – The (name of the) site class for the species; usually just FermionSite.

  • cons_N (None | "N", "parity", "None") – Whether to conserve the (parity of the) total particle number N_up + N_down.

  • cons_Sz (None | "Sz", "parity", "None") – Whether to conserve the (parity of the) total Sz spin N_up - N_down.

Returns:

  • sites (list of SpeciesSite) – Each one instance of the site for spin up and down.

  • species_names (list of str) – Always ['up', 'down']. Included such that a return spin_half_species(...) in init_sites() triggers the use of the MultiSpeciesLattice.