13 json[
"asym"] = cand.
asym;
21 json[
"asym"].get<Index>(),
27 std::ostream &operator<<(std::ostream &sout, std::pair<const OccCandidate &, const Conversions &> value) {
28 sout <<
"(" << value.second.species_name(value.first.species_index) <<
", "
29 << value.first.
asym <<
")";
50 std::ostream &operator<<(std::ostream &sout, std::pair<const OccSwap &, const Conversions &> value) {
51 sout << std::pair<const OccCandidate &, const Conversions &>(value.first.cand_a, value.second)
52 <<
" <-> " << std::pair<const OccCandidate &, const Conversions &>(value.first.cand_b, value.second);
79 std::vector<Index> unallowed(Nspecies,
m_end);
110 return cand_a.
asym == cand_b.asym &&
116 for(
const auto &cand_b : m_candidate) {
120 if(cand_a < cand_b && allowed_canonical_swap(cand_a, cand_b)) {
126 if(allowed_grand_canonical_swap(cand_a, cand_b)) {
139 for(
auto it = list.
begin(); it != list.
end(); ++it) {
148 json[
"grand_canonical_swap"].
put_array();
156 std::ostream &operator<<(std::ostream &sout, std::pair<const OccCandidateList &, const Conversions &> value) {
158 typedef std::pair<const OccCandidate &, const Conversions &> cand_pair;
159 typedef std::pair<const OccSwap &, const Conversions &> swap_pair;
163 sout <<
"Unit cell for determining equivalent swaps: \n" <<
166 sout <<
"Asymmetric Unit: " << std::endl;
168 sout <<
" " << asym <<
": ";
175 for(
auto it =
set.begin(); it !=
set.end(); ++it) {
181 sout <<
"Candidates: (Species, AsymUnit)" << std::endl;
182 for(
auto it = list.
begin(); it != list.
end(); ++it) {
183 sout <<
" " << cand_pair(*it, convert) <<
"\n";
187 sout <<
"Canonical swaps: " << std::endl;
189 sout <<
" " << swap_pair(*it, convert) <<
"\n";
193 sout <<
"Grand canonical swaps: " << std::endl;
195 sout <<
" " << cand_pair(it->cand_a, convert) <<
" -> " << cand_pair(it->cand_b, convert) <<
"\n";
std::vector< OccSwap > m_grand_canonical_swap
vector of allowed grand canonical swaps
const std::set< Index > & asym_to_unitl(Index asym) const
const_iterator begin() const
bool species_allowed(Index asym, Index species_index) const
void _make_possible_swaps(const Conversions &convert)
Construct m_canonical_swaps, m_grand_canonical_swaps.
const std::string & species_name(Index species_index) const
const std::vector< OccSwap > & canonical_swap() const
std::vector< OccSwap > m_canonical_swap
vector of allowed canonical swaps
jsonParser & to_json(const CanonicalConditions &conditions, jsonParser &json)
Store CanonicalConditions in JSON format.
Index species_size() const
std::vector< OccCandidate > m_candidate
T get(Args...args) const
Get data from json, using one of several alternatives.
const_iterator end() const
void swap(ConfigDoF &A, ConfigDoF &B)
EigenIndex Index
For long integer indexing:
Store swap type, mutating sites, and info for keeping OccLocation up-to-date.
static ReturnType from_json(const jsonParser &json)
Default from_json is equivalent to.
UnitCellCoord unitl_to_bijk(Index unitl) const
List of asym / species_index pairs indicating allowed variable occupation dof.
Index m_end
Number of allowed candidates, what is returned if a candidate is not allowed.
Helper struct for constructing objects that need additional data.
jsonParser & put_obj()
Puts new empty JSON object.
jsonParser & push_back(const T &value)
Puts new valued element at end of array of any type T for which 'jsonParser& to_json( const T &value...
Index index(const OccCandidate &cand) const
Return index into std::vector, or _candidate.size() if not allowed. ...
Index species_index(Index asym, Index occ_index) const
const Eigen::Matrix3i & get_transf_mat() const
std::vector< std::vector< Index > > m_species_to_cand_index
m_converter[asym][species_index] -> candidate_index
const Supercell & unit_scel() const
Index occ_size(Index asym) const
jsonParser & put_array()
Puts new empty JSON array.
const std::vector< OccSwap > & grand_canonical_swap() const