13 json[
"asym"].get<Index>(),
32 json[
"asym"] = cand.
asym;
39 std::pair<const OccCandidate &, const Conversions &> value) {
40 sout <<
"(" << value.second.species_name(value.first.species_index) <<
", "
41 << value.first.asym <<
")";
55 std::ostream &sout, std::pair<const OccSwap &, const Conversions &> value) {
56 sout << std::pair<const OccCandidate &, const Conversions &>(
57 value.first.cand_a, value.second)
59 << std::pair<const OccCandidate &, const Conversions &>(
60 value.first.cand_b, value.second);
84 std::vector<Index> unallowed(Nspecies,
m_end);
113 auto allowed_grand_canonical_swap = [&](
OccCandidate cand_a,
115 return cand_a.
asym == cand_b.asym &&
125 if (cand_a < cand_b && allowed_canonical_swap(cand_a, cand_b)) {
131 if (allowed_grand_canonical_swap(cand_a, cand_b)) {
145 for (
auto it = list.
begin(); it != list.
end(); ++it) {
155 json[
"grand_canonical_swap"].
put_array();
166 std::pair<const OccCandidateList &, const Conversions &> value) {
167 typedef std::pair<const OccCandidate &, const Conversions &> cand_pair;
168 typedef std::pair<const OccSwap &, const Conversions &> swap_pair;
172 sout <<
"Unit cell for determining equivalent swaps: \n"
175 sout <<
"Asymmetric Unit: " << std::endl;
177 sout <<
" " << asym <<
": ";
184 for (
auto it =
set.begin(); it !=
set.end(); ++it) {
190 sout <<
"Candidates: (Species, AsymUnit)" << std::endl;
191 for (
auto it = list.
begin(); it != list.
end(); ++it) {
192 sout <<
" " << cand_pair(*it, convert) <<
"\n";
196 sout <<
"Canonical swaps: " << std::endl;
199 sout <<
" " << swap_pair(*it, convert) <<
"\n";
203 sout <<
"Grand canonical swaps: " << std::endl;
206 sout <<
" " << cand_pair(it->cand_a, convert) <<
" -> "
207 << cand_pair(it->cand_b, convert) <<
"\n";
const Supercell & unit_scel() const
Index species_index(Index asym, Index occ_index) const
const std::set< Index > & asym_to_unitl(Index asym) const
Index occ_size(Index asym) const
UnitCellCoord unitl_to_bijk(Index unitl) const
bool species_allowed(Index asym, Index species_index) const
const std::string & species_name(Index species_index) const
Index species_size() const
void _make_possible_swaps(const Conversions &convert)
Construct m_canonical_swaps, m_grand_canonical_swaps.
std::vector< std::vector< Index > > m_species_to_cand_index
m_converter[asym][species_index] -> candidate_index
Index index(const OccCandidate &cand) const
const std::vector< OccSwap > & canonical_swap() const
const_iterator begin() const
std::vector< OccSwap > m_canonical_swap
vector of allowed canonical swaps
const std::vector< OccSwap > & grand_canonical_swap() const
std::vector< OccSwap > m_grand_canonical_swap
vector of allowed grand canonical swaps
const_iterator end() const
std::vector< OccCandidate > m_candidate
Store swap type, mutating sites, and info for keeping OccLocation up-to-date.
Eigen::Matrix3l transf_mat() const
jsonParser & put_obj()
Puts new empty JSON object.
jsonParser & put_array()
Puts new empty JSON array.
jsonParser & push_back(const T &value, Args &&... args)
T get(Args &&... args) const
Get data from json, using one of several alternatives.
jsonParser & to_json(const CanonicalConditions &conditions, jsonParser &json)
Store CanonicalConditions in JSON format.
std::ostream & operator<<(std::ostream &sout, const CanonicalConditions &cond)
void swap(ConfigDoF &A, ConfigDoF &B)
INDEX_TYPE Index
For long integer indexing:
Helper struct for constructing objects that need additional data.
static ReturnType from_json(const jsonParser &json)
Default from_json is equivalent to.