QN
Description
ITensors.QuantumNumbers.QN — TypeA QN object stores a collection of up to four named values such as ("Sz",1) or ("N",0). These values can include a third integer "m" which makes them obey addition modulo m, for example ("P",1,2) for a value obeying addition mod 2. (The default is regular integer addition).
Adding or subtracting pairs of QN objects performs addition and subtraction element-wise on each of the named values. If a name is missing from the collection, its value is treated as zero.
Constructors
ITensors.QuantumNumbers.QN — MethodQN(qvs...)Construct a QN from a set of up to four named value tuples.
Examples
q = QN(("Sz",1))
q = QN(("N",1),("Sz",-1))
q = QN(("P",0,2),("Sz",0)).ITensors.QuantumNumbers.QN — TypeQN(name,val::Int,modulus::Int=1)Construct a QN with a single named value by providing the name, value, and optional modulus.
ITensors.QuantumNumbers.QN — TypeQN(val::Int,modulus::Int=1)Construct a QN with a single unnamed value (equivalent to the name being the empty string) with optional modulus.
Properties
ITensors.val — Methodval(q::QN,name)Get the value within the QN q corresponding to the string name
ITensors.QuantumNumbers.modulus — Methodmodulus(q::QN,name)Get the modulus within the QN q corresponding to the string name
Related Functions
Base.zero — Methodzero(q::QN)Returns a QN object containing the same names as q, but with all values set to zero.