A 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.
Construct a QN from a set of up to four named value tuples.
q = QN(("Sz",1)) q = QN(("N",1),("Sz",-1)) q = QN(("P",0,2),("Sz",0)).
Construct a QN with a single named value by providing the name, value, and optional modulus.
Construct a QN with a single unnamed value (equivalent to the name being the empty string) with optional modulus.
Get the value within the QN q corresponding to the string
Get the modulus within the QN q corresponding to the string
Returns a QN object containing the same names as q, but with all values set to zero.