Skip to content

read_permutation_group

Reads an PermutationGroup object from a TOML file.

Sources read.hpp, read.cpp


Definition

OpSum read_permutation_group(FileToml file, std::string tag);
read_permutation_group(file::FileToml, tag::String)::PermutationGroup

Parameters

Name Description
file FileToml object from which the PermutationGroup is read
tag tag which holds the information in the TOML file about the PermutatioGroup

Data format

A PermutationGroup can be defined in a TOML file as an integer matrix, where the rows are the integers of the permutation.

A typical specification of a \(C_4\) PermutationGroup is shown here:

Symmetries = [
  [0, 1, 2, 3],
  [1, 2, 3, 0],
  [2, 3, 0, 1],
  [3, 0, 1, 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

std::string file = XDIAG_DIRECTORY "/misc/data/triangular.9.hop.sublattices.tsl.toml";
auto fl = FileToml(file);
auto group = read_permutation_group(fl, "Symmetries");
XDIAG_SHOW(group);
file = "triangular.9.hop.sublattices.tsl.toml"
fl = FileToml(file)
group = read_permutation_group(fl, "Symmetries")
@show group