read_representation
Reads an Representation object from a TOML file.
Definition
Parameters
Name | Description | |
---|---|---|
file | FileToml object from which the Representation is read | |
irrep_tag | tag which holds the information about the Representation in the TOML file | |
group_tag | tag which holds the information about the PermutationGroup in the TOML file | "Symmetries" |
Data format
A Representation can be defined in a TOML file by specifying up two or three things:
- The PermutationGroup as an integer matrix
- The
characters
of the representation - (optional) the
allowed_symmetries
of the representation, i.e. a list of the number of symmetries used in the irrep. By default all symmetries of the group are used in the representation.
A typical specification of several Representations is shown here:
Symmetries = [
[0, 1, 2, 3],
[1, 2, 3, 0],
[2, 3, 0, 1],
[3, 0, 1, 2]
]
# real irrep, momentum 0
[k_0]
characters=[1.0, 1.0, 1.0, 1.0]
# complex irrep, momentum pi/2
[k_pi2]
characters=[
[1.0, 0.0],
[0.0, 1.0],
[-1.0, 0.0],
[0.0, -1.0]
]
# real irrep, momentum pi
[k_pi]
characters=[1.0, -1.0, 1.0, -1.0]
# real irrep on subgroup
[k_pi2_half]
characters=[1.0, -1.0]
allowed_symmetries=[0, 2]
1-indexing in Julia / 0-indexing in C++
To enumerate the sites of a Permutation, we start counting at 1 in Julia and 0 in C++.
Usage Example
The example reads the representation defined in the irreps.toml
file, whose contents are shown up in the section Data format.
std::string file = XDIAG_DIRECTORY "/misc/data/irreps.toml";
auto fl = FileToml(file);
auto k_0 = read_representation(fl, "k_0");
XDIAG_SHOW(k_0);
XDIAG_SHOW(isreal(k_0));
auto k_pi2 = read_representation(fl, "k_pi2");
XDIAG_SHOW(k_pi2);
XDIAG_SHOW(isreal(k_pi2));
auto k_pi = read_representation(fl, "k_pi");
XDIAG_SHOW(k_pi);
XDIAG_SHOW(isreal(k_pi));
auto k_pi2_half = read_representation(fl, "k_pi2_half");
XDIAG_SHOW(k_pi2_half);
XDIAG_SHOW(isreal(k_pi2_half));
file = "irreps.toml"
fl = FileToml(file)
k_0 = read_representation(fl, "k_0")
@show k_0
@show isreal(k_0)
k_pi2 = read_representation(fl, "k_pi2")
@show k_pi2
@show isreal(k_pi2)
k_pi = read_representation(fl, "k_pi")
@show k_pi
@show isreal(k_pi)
k_pi2_half = read_representation(fl, "k_pi2_half")
@show k_pi2_half
@show isreal(k_pi2_half)