TBTK
Need a break? Support the development by playing Polarity Puzzles
Subindex.h File Reference

An entry in an Index. More...

#include "TBTK/Integer.h"
#include "TBTK/Natural.h"
#include "TBTK/PseudoSerializable.h"
#include "TBTK/json.hpp"

Go to the source code of this file.

Classes

class  TBTK::Subindex
 An entry in an Index. More...
 

Variables

constexpr Subindex TBTK::IDX_FLAG_MASK = (int)0x00FFFFFF
 Special subindex values. More...
 
constexpr Subindex TBTK::IDX_ALL = (int)(0xBFFFFFFF & ~0x20000000)
 
constexpr Subindex TBTK::_a_ = IDX_ALL
 
constexpr Subindex TBTK::IDX_SUM_ALL = (int)(0xBFFFFFFF & ~0x20000001)
 
constexpr Subindex TBTK::IDX_SPIN = (int)(0xBFFFFFFF & ~0x20000002)
 
constexpr Subindex TBTK::IDX_SEPARATOR = (int)(0xBFFFFFFF & ~0x20000003)
 
constexpr Subindex TBTK::IDX_ALL_ = (int)(0xBFFFFFFF & ~0x10000000)
 
constexpr Subindex TBTK::_aX_ = IDX_ALL_
 
constexpr Subindex TBTK::IDX_RANGE = (int)(0xBFFFFFFF & ~0x08000000)
 
constexpr Subindex TBTK::IDX_X = (int)(IDX_RANGE & ~0x00000000)
 
constexpr Subindex TBTK::IDX_Y = (int)(IDX_RANGE & ~0x00000001)
 
constexpr Subindex TBTK::IDX_Z = (int)(IDX_RANGE & ~0x00000002)
 

Detailed Description

An entry in an Index.

Author
Kristofer Björnson

Variable Documentation

◆ IDX_FLAG_MASK

constexpr Subindex TBTK::IDX_FLAG_MASK = (int)0x00FFFFFF
constexpr

Special subindex values.

Negative Subindex values with the second uppermost bit set to zero are reserved for flags.

IDX_ALL = a:
Wildcard Used to indicate that all indices are to be considered or that the particular subindex value is of no interest. To improve self-documentation for library code, only IDX_ALL should be used in library code. 'a' is syntactic sugar meant for use in application code.

IDX_SUM_ALL:
: Used to indicate that a subindex should be summed over.

IDX_SPIN:
Used to indicate that a subindex should be interpreted as a spin-subindex.

IDX_SEPARATOR:
Used as Index-separator in compound indices such as {{1, 2}, {3, 4}}, which is stored as {1, 2, IDX_SEPARATOR, 3, 4}.

IDX_ALL_ = aX: Labeled wildcards. Are used for the same purpose as wildcard indices (IDX_ALL), but where two or more subindices should covary. The function call operator works together with IDX_ALL_ to create wildcards with different labels. For example, {IDX_ALL_(0), 1, IDX_ALL_(1), IDX_ALL_(0), IDX_ALL_(1)} indicates that all indices of the form {m, 1, n, m, n} are of interest. To improve self-documentation, only IDX_ALL_ should be used in library code. 'aX' is syntactic sugar meant for use in application code.

IDX_X, IDX_Y, IDX_Z:
Loop indices used to indicate that a particular index should be looped over.