Defining a DoF-object
In SymBasis.jl, to generate a basis, you first need to define an object with degrees of freedom (DoF-object) that represents the system you are interested in.
Predefined DoF-objects
SymBasis.jl provides predefined DoF-objects for commonly used systems.
Quantum mechanical spins
Define a spin DoF-object using the dof_object function and the Spin type from the SymBasis.DoFObjects submodule as follows:
using SymBasis.DoFObjects
s = 1//2 # spin quantum number
dofo = dof_object(Spin(s))DoFObject: Spin (B=2)
ldof: (-1//2, 1//2)
index types: T=UInt64, Ti=Int64This creates a spin-1/2 DoF-object for specifying symmetries and generating bases.
Custom DoF-objects
In addition to the predefined DoF-objects, you can also define your own custom DoF-objects for other types of systems. For example, if you want to define a DoF-object for a system containing flag emojis of countries, you can do so by defining a tuple of the flag emojis and then using the DoFObject constructor from the SymBasis.DoFObjects submodule as follows:
using SymBasis.DoFObjects
countries = ("🇹🇷", "🇩🇪", "🇺🇸", "🇬🇧", "🇫🇷")
dofo = DoFObject(:Country, countries)DoFObject: Country (B=5)
ldof: ("🇹🇷", "🇩🇪", "🇺🇸", "🇬🇧", "🇫🇷")
index types: T=UInt64, Ti=Int64