Hi,

I have been trying to define my own SiteType by following the "Electron" site type source code on Github, but I got confused by the different versions where the usage of val() function and state() function varies.

To be precise, for https://github.com/ITensor/ITensors.jl/blob/main/src/physics/site_types/electron.jl

The val() function is used, and the state() function is assigned vectors.

However, for https://github.com/ITensor/ITensors.jl/blob/629_setindex_complex/src/physics/site_types/electron.jl

The val() function is not used, and the state() function is assigned integer scalars.

I roughly understand that the state() function serves as a basis for defining the matrix operators, so are both vectors and scalars fine?

Also, what exactly does the val() function do?

Thanks a lot for your help,

Mason