1 #include <boost/filesystem.hpp>
2 #include <boost/filesystem/fstream.hpp>
3 #include <boost/lexical_cast.hpp>
4 #include <boost/tokenizer.hpp>
42 template class HasPrimClex<Comparisons<Calculable<CRTPBase<Configuration> > > >;
43 template class HasSupercell<
44 Comparisons<Calculable<CRTPBase<Configuration> > > >;
45 template class ConfigCanonicalForm<
46 HasSupercell<Comparisons<Calculable<CRTPBase<Configuration> > > > >;
49 template class Indexed<CRTPBase<Configuration> >;
50 template class Named<CRTPBase<Configuration> >;
54 std::shared_ptr<Supercell const>
const &_supercell_ptr)
55 : m_supercell(_supercell_ptr.
get()),
56 m_supercell_ptr(_supercell_ptr),
60 std::shared_ptr<Supercell const>
const &_supercell_ptr,
62 : m_supercell(_supercell_ptr.
get()),
63 m_supercell_ptr(_supercell_ptr),
67 const std::shared_ptr<Supercell const> &_supercell_ptr) {
72 const std::shared_ptr<Supercell const> &_supercell_ptr,
double _tol) {
80 : m_supercell(&_supercell),
86 : m_supercell(&_supercell), m_configdof(_configdof) {}
113 if (!cache().
contains(
"is_primitive")) {
116 cache_insert(
"is_primitive", result);
119 return cache()[
"is_primitive"].get<
bool>();
131 if (++begin == end) {
134 return std::find_if(begin, end, f);
156 crystallography_tol())
163 std::make_shared<Supercell>(&
primclex(), new_lat), tconfig);
201 if (result.insert_primitive) {
202 result.primitive_it->supercell().set_primclex(&
primclex());
204 if (result.insert_canonical) {
205 result.canonical_it->supercell().set_primclex(&
primclex());
220 if (fg.size() == 0) {
221 err_log() <<
"Something went very wrong in invariant_subgroup returning "
225 int mult = this->prim().factor_group().size() / fg.size();
226 cache_insert(
"multiplicity", mult);
231 if (!cache().
contains(
"is_canonical")) {
233 cache_insert(
"is_canonical", result);
236 return cache()[
"is_canonical"].get<
bool>();
241 std::vector<PermuteIterator> config_factor_group =
factor_group();
242 std::vector<PermuteIterator> result;
243 for (
int i = 0; i < config_factor_group.size(); i++) {
244 if (i == 0 || config_factor_group[i].factor_group_index() !=
245 config_factor_group[i - 1].factor_group_index())
246 result.push_back(config_factor_group[i]);
254 if (!cache().
contains(
"point_group_name")) {
261 return cache()[
"point_group_name"].get<std::string>();
286 config.crystallography_tol());
295 for (
auto op1 = begin; op1 != end; ++op1) {
297 Configuration super_configuration = fill_supercell_f(*res.first, test);
298 if (is_equal_to_f(super_configuration)) {
304 throw std::runtime_error(
305 "Error in RefToCanonicalPrim: could not find solution");
340 if (
id() !=
"none") {
345 throw std::runtime_error(
346 "Error in Configuration::generate_name_impl: No PrimClex pointer.");
351 bool is_canon_equiv_lat =
355 if (is_canon_equiv_lat) {
362 auto find_it = db.search(canon_scel_config);
365 if (find_it != db.end()) {
367 set_id(find_it->id());
382 auto find_it = db.search(canon_config);
383 std::string canon_config_id =
"none";
384 if (find_it != db.end()) {
385 canon_config_id = find_it->id();
389 return supercell().
name() +
"/" + canon_config_id +
".equiv." +
417 return prim().basis()[
sublat(site_l)].occupant_dof()[
occ(site_l)];
424 if (!cache().
contains(
"multiplicity")) {
426 this->prim().factor_group().size() / this->
factor_group().size();
427 cache_insert(
"multiplicity", result);
430 return cache()[
"multiplicity"].get<
int>();
434 auto all_props = calc_properties_map();
436 for (
auto it = all_props.begin(); it != all_props.end(); ++it) {
451 _sublat_num_each_molecule.size());
454 for (
Index i = 0; i < _sublat_num_each_molecule.size(); i++) {
456 Eigen::VectorXd::Zero(_sublat_num_each_molecule[i].
size());
457 for (
Index j = 0; j < _sublat_num_each_molecule[i].size(); j++) {
475 for (i = 0; i < prim().basis().size(); i++) {
477 Eigen::VectorXi::Zero(prim().basis()[i].occupant_dof().
size()));
481 for (i = 0; i <
size(); i++) {
502 for (i = 0; i < struc_mol.size(); i++) {
505 _num_each_molecule[i] = 0;
507 num_atoms += _num_each_molecule[i];
512 return _num_each_molecule.cast<
double>() /
double(num_atoms);
530 if (!
primclex().has_composition_axes()) {
531 std::cerr <<
"Error in Configuration::param_composition()" << std::endl;
532 std::cerr <<
" Composition axes are not set." << std::endl;
543 std::vector<std::string> components =
544 primclex().composition_axes().components();
558 for (
Index i = 0; i < components.size(); i++) {
577 std::vector<std::string> splt_vec;
578 boost::split(splt_vec,
configname, boost::is_any_of(
"/"),
579 boost::token_compress_on);
580 if (splt_vec.size() != 2) {
583 err_log() <<
"must have form: scelname/configid" << std::endl;
584 throw std::invalid_argument(
585 "Error in Configuration::split_name(const std::string &configname) "
589 return std::make_pair(splt_vec[0], splt_vec[1]);
603 if (sub_scel_ptr->shared_prim() != super_config.shared_prim()) {
604 throw std::runtime_error(
"Error sub_configuration: prim is not the same.");
614 for (
Index i = 0; i < sub_config.size(); i++) {
626 sub_config.configdof().occ(i) = super_config.
occ(site_index);
632 sub_config.configdof().local_dof(dof.first));
633 for (
Index i = 0; i < sub_config.size(); i++) {
638 Index scel_site_index =
642 res_ref.
site_value(i) = dof.second.site_value(scel_site_index);
655 Configuration make_non_canon_configuration(
const PrimClex &
primclex,
657 std::string format =
"$CANON_CONFIGNAME.equiv.$FG_PERM.$TRANS_PERM";
660 std::vector<std::string> tokens;
661 boost::split(tokens,
name, boost::is_any_of(
"."), boost::token_compress_on);
662 std::string canon_config_name = tokens[0];
663 if (tokens.size() != 4) {
665 err_log() <<
"expected format: " << format <<
"\n";
667 err_log() <<
"tokens: " << tokens << std::endl;
668 throw std::invalid_argument(
669 "Error in make_configuration: configuration name format error");
672 Configuration canon_config =
674 Index fg_index = boost::lexical_cast<Index>(tokens[2]);
675 Index trans_index = boost::lexical_cast<Index>(tokens[3]);
678 canon_config.supercell().sym_info().permute_it(fg_index, trans_index),
694 Configuration make_super_configuration(
const PrimClex &
primclex,
697 std::string format =
"$SCEL_NAME/super.$PRIM_FG_OP2.$NONCANON_CONFIG_NAME";
700 std::vector<std::string> tokens;
701 boost::split(tokens,
name, boost::is_any_of(
"./"), boost::token_compress_on);
703 std::string
scelname, non_canon_config_name;
704 Index fg_op_index = 0;
706 if (tokens[1] !=
"super" && tokens[2] !=
"super") {
708 err_log() <<
"expected format: " << format <<
"\n";
710 err_log() <<
"tokens: " << tokens << std::endl;
712 throw std::invalid_argument(
713 "Error in make_configuration: configuration name format error");
718 if (tokens[1] ==
"super") {
720 fg_op_index = boost::lexical_cast<Index>(tokens[2]);
721 non_canon_config_name = tokens[3] +
'/' + tokens[4] +
'.' + tokens[5] +
722 '.' + tokens[6] +
'.' + tokens[7];
726 scelname = tokens[0] +
'.' + tokens[1];
727 fg_op_index = boost::lexical_cast<Index>(tokens[3]);
728 non_canon_config_name = tokens[4] +
'/' + tokens[5] +
'.' + tokens[6] +
729 '.' + tokens[7] +
'.' + tokens[8];
733 err_log() <<
"expected format: " << format <<
"\n";
735 err_log() <<
"tokens: " << tokens << std::endl;
737 throw std::invalid_argument(
738 "Error in make_configuration: configuration name format error");
744 Configuration non_canon_config =
745 make_non_canon_configuration(
primclex, non_canon_config_name);
750 if (tokens[1] ==
"super") {
786 if (
name.find(
"super") != std::string::npos) {
792 if (
name.find(
"equiv") != std::string::npos) {
811 config.supercell(), clexulator);
819 return point_corr(linear_unitcell_index, neighbor_index,
config.configdof(),
820 config.supercell(), clexulator);
833 return config.param_composition();
838 return config.num_each_component();
843 if (
config.primclex().vacancy_allowed()) {
862 if (
config.primclex().vacancy_allowed()) {
863 v(
config.primclex().vacancy_index()) = 0.0;
876 return config.calc_properties().scalar(
"energy") /
877 config.supercell().volume();
919 err_log <<
"using cluster expansion: 'formation_energy'" << std::endl;
921 err_log <<
"max eci index: " <<
eci.index().back() << std::endl;
922 throw std::runtime_error(
"Error: bset and eci mismatch");
936 return _config.calc_properties().scalar(
"atomic_deformation");
941 return _config.calc_properties().scalar(
"lattice_deformation");
947 return tconvert.
rollup_E(_config.calc_properties().global.at(
"Ustrain"))
953 return _config.calc_properties().scalar(
"relaxed_magmom");
964 return _config.calc_properties().site.at(
"relaxed_forces");
973 return sqrt((F * F.transpose()).trace() /
double(F.cols()));
981 throw std::runtime_error(
982 "Misuse of basic config_diff: configs are not in same supercell");
984 std::vector<UnitCellCoord> uccoords;
986 if (_config1.
occ(i) != _config2.
occ(i)) {
987 uccoords.push_back(_config1.
uccoord(i));
990 IntegralCluster perturb(_config1.prim(), uccoords.begin(), uccoords.end());
998 std::vector<PermuteIterator> non_fg_its;
1003 std::back_inserter(non_fg_its));
1005 if (non_fg_its.size() == 0) {
1009 for (
auto it = non_fg_its.begin(); it != non_fg_its.end(); ++it) {
1011 if (size < min_size) {
1016 if (min_size ==
config_diff(_config1, _config2).size()) {
1027 throw std::runtime_error(
1028 "Misuse of basic config_clip: configs are not in same supercell");
1031 std::vector<Index> l_inds;
1032 std::vector<Index> l_values;
1033 for (
auto &site : _clust) {
1037 for (
Index i = 0; i < l_inds.size(); i++) {
1038 tmp.
set_occ(l_inds[i], l_values[i]);
1056 return _config.calc_properties().has_scalar(
"energy");
1060 return _config.primclex().has_composition_axes() &&
1061 _config.primclex().has_chemical_reference();
1070 auto it = props.
site.find(
"relaxed_forces");
1071 return it != props.
site.end() && it->second.cols();
1075 return _config.calc_properties().has_scalar(
"atomic_deformation");
1079 return _config.calc_properties().has_scalar(
"lattice_deformation");
1083 return _config.calc_properties().global.count(
"Ustrain");
1087 return _config.calc_properties().has_scalar(
"relaxed_magmom");
1091 return _config.calc_properties().site.count(
"relaxed_mag_basis");
1095 sout << c.name() <<
"\n";
1101 sout <<
"Linear index: " << i <<
" UnitCellCoord: " << c.
uccoord(i)
1104 sout <<
" Occupation: " << c.
occ(i) <<
" (" << c.
mol(i).
name() <<
")\n";
1120 int scel_vol = scel.
volume();
1130 for (
int v = 0; v < scel_vol; v++) {
1134 tcorr.data(),
end_ptr(tcorr));
1151 if (linear_unitcell_index >= scel.
volume()) {
1152 std::stringstream msg;
1153 msg <<
"Error in point_corr: linear_unitcell_index out of range ("
1154 << linear_unitcell_index <<
" >= " << scel.
volume() <<
")";
1155 throw std::runtime_error(msg.str());
1159 auto const &unitcell_nlist = scel.
nlist().
sites(linear_unitcell_index);
1161 configdof, unitcell_nlist.data(),
end_ptr(unitcell_nlist),
1172 if (linear_unitcell_index >= scel.
volume()) {
1173 std::stringstream msg;
1174 msg <<
"Error in point_corr: linear_unitcell_index out of range ("
1175 << linear_unitcell_index <<
" >= " << scel.
volume() <<
")";
1176 throw std::runtime_error(msg.str());
1181 auto const &unitcell_nlist = scel.
nlist().
sites(linear_unitcell_index);
1183 std::stringstream msg;
1184 msg <<
"Error in point_corr: neighbor_index out of range ("
1185 << neighbor_index <<
" >= " << clexulator.
n_point_corr() <<
")";
1186 throw std::runtime_error(msg.str());
1189 configdof, unitcell_nlist.data(),
end_ptr(unitcell_nlist),
1204 paramkey = clexulator.
param_pack().
key(
"diff/corr/" + key +
"_site_func");
1207 paramkey = clexulator.
param_pack().
key(
"diff/corr/" + key +
"_var");
1211 std::string em_corr, em_dof;
1220 .set_eval_mode(corr_key,
"DIFF");
1223 .set_eval_mode(dof_key,
"DIFF");
1229 gcorr.setZero(gcorr_func.size(), clexulator.
corr_size());
1233 for (
int v = 0; v < scel_vol; v++) {
1248 for (
int v = 0; v < scel_vol; v++) {
1260 gcorr.block(l * gcorr_func.rows(), c, gcorr_func.rows(), 1) +=
1272 .set_eval_mode(corr_key, em_corr);
1275 .set_eval_mode(dof_key, em_dof);
1292 for (
Index i = 0; i < configdof.
size(); i++) {
std::shared_ptr< Structure const > shared_prim
Specifies traits of (possibly) anisotropic crystal properties.
bool global() const
Returns true if type is global.
Key for indexing clexulator parameters Contains pointer to implementation of the Key.
virtual std::string eval_mode(ClexParamKey const &_key) const =0
Check evaluation mode for ClexParamPack parameter Choices are at least.
ClexParamKey const & key(std::string const &_name) const
Obtain key for managed data block by name.
virtual Eigen::MatrixXd const & read(ClexParamKey const &_key) const =0
Returns const reference to parameter array for parameter specified by.
size_type corr_size() const
Number of correlations.
ClexParamPack const & param_pack() const
Obtain const reference to abstract ClexParamPack object.
void calc_global_corr_contribution(ConfigDoF const &_input_configdof, long int const *_nlist_begin, long int const *_nlist_end, double *_corr_begin, double *_corr_end) const
Calculate contribution to global correlations from one unit cell.
size_type n_point_corr() const
Valid range for neighbor_ind argument to calc_point_corr.
Index size() const
Number of sites in the ConfigDoF.
std::map< DoFKey, LocalContinuousConfigDoFValues > const & local_dofs() const
void set_global_dof(DoFKey const &_key, Eigen::Ref< const Eigen::VectorXd > const &_val)
Set global continuous DoF values.
std::map< DoFKey, GlobalContinuousConfigDoFValues > const & global_dofs() const
GlobalContinuousConfigDoFValues const & global_dof(DoFKey const &_key) const
ConfigDoF & apply_sym(PermuteIterator const &it)
int & occ(Index i)
Reference occupation value on site i.
LocalContinuousConfigDoFValues const & local_dof(DoFKey const &_key) const
Class for comparison of Configurations (with the same Supercell)
Eigen::VectorXd num_each_component() const
bool is_canonical() const
const ConfigDoF & configdof() const
const Access the DoF
static Configuration zeros(const std::shared_ptr< Supercell const > &_supercell_ptr)
void set_occupation(Eigen::Ref< const Eigen::VectorXi > const &_occupation)
Set occupant variables.
Configuration primitive() const
Return the primitive Configuration.
Eigen::VectorXi const & occupation() const
Occupant variables.
std::vector< Eigen::VectorXd > sublattice_composition() const
Configuration & apply_sym(const PermuteIterator &it)
Transform Configuration from PermuteIterator via *this = permute_iterator * *this.
ConfigIsEquivalent equal_to() const
bool eq_impl(const Configuration &B) const
operator== comparison of Configuration, via ConfigEqual
bool has_occupation() const
True if Configuration has occupation DoF.
Configuration(std::shared_ptr< Supercell const > const &_supercell_ptr)
Eigen::VectorXi num_each_molecule() const
Eigen::VectorXd true_composition() const
const Lattice & ideal_lattice() const
std::vector< PermuteIterator > point_group() const
Returns the point group that leaves the Configuration unchanged.
PermuteIterator find_translation() const
Returns a PermuteIterator corresponding to the first non-zero pure translation that maps the Configur...
std::vector< Eigen::VectorXi > sublat_num_each_molecule() const
std::vector< PermuteIterator > invariant_subgroup() const
Returns the subgroup of the Supercell factor group that leaves the Configuration unchanged.
Index linear_index(const UnitCellCoord &bijk) const
Return the linear index corresponding to integral coordinates.
ConfigInsertResult insert(bool primitive_only=false) const
Insert this configuration (in primitive & canonical form) in the database.
Supercell const * m_supercell
Pointer to the Supercell for this Configuration.
std::string generate_name_impl() const
Returns a Configuration name.
UnitCellCoord uccoord(Index site_l) const
Get the UnitCellCoord for a given linear site index.
const Molecule & mol(Index site_l) const
Molecule on site l.
Eigen::VectorXd param_composition() const
Returns parametric composition, as calculated using PrimClex::param_comp.
const int & occ(Index site_l) const
Occupant variable on site l.
void init_occupation()
Set occupant variables to background structure.
static std::pair< std::string, std::string > split_name(std::string configname)
Split configuration name string into scelname and config id.
int multiplicity() const
Get symmetric multiplicity, excluding translations.
ConfigCompare less() const
const Supercell & supercell() const
Get the Supercell for this Configuration.
ConfigDoF m_configdof
Degrees of Freedom.
Eigen::VectorXd composition() const
Configuration in_canonical_supercell() const
Returns the canonical form Configuration in the canonical Supercell.
void set_occ(Index site_l, int val)
Set occupant variable on site l.
std::string point_group_name() const
Returns the point group that leaves the Configuration unchanged.
int sublat(Index site_l) const
Get the basis site index for a given linear linear site index.
Index size() const
Returns number of sites, NOT the number of primitives that fit in here.
bool is_primitive() const
Check if this is a primitive Configuration.
bool operator<(const Configuration &B) const
Clear occupation.
std::vector< PermuteIterator > factor_group() const
Returns the subgroup of the Supercell factor group that leaves the Configuration unchanged.
A sparse container of ECI values and their corresponding orbit indices.
size_type size() const
Number of elements in the cluster.
Class for less than comparison of Configurations implemented via a ConfigTypeIsEqual class that also ...
Eigen::VectorXd const & values() const
Const access global DoF values.
SiteReference site_value(Index l)
Access site DoF value vector.
Eigen::MatrixXd const & values() const
Const access DoF values (prim DoF basis, matrix representing all sites)
void error(const std::string &what)
static const int standard
SupercellSymInfo const & sym_info() const
Reference the SupercellSymInfo containing the operations being pointed at.
Index factor_group_index() const
Return the supercell factor group index.
Index translation_index() const
Return the index into the supercell translation permutations.
PrimClex is the top-level data structure for a CASM project.
ClexDescription const & clex(std::string clex_name) const
Get a ClexDescription by name.
Matrix3d rollup_E(Eigen::Ref< const VectorXd > const &_unrolled_E) const
const MasterSymGroup & factor_group() const
const std::vector< size_type > & sites(size_type unitcell_index) const
const Access the list of sites neighboring a particular unit cell
Represents a supercell of the primitive parent crystal structure.
Index sublat(Index linear_index) const
Return the sublattice index for a linear index.
Index linear_index(const Coordinate &coord, double tol=TOL) const
Given a Coordinate and tolerance, return linear index into Configuration.
UnitCellCoord uccoord(Index linear_index) const
Return the integral coordinates corresponding to a linear index.
const Lattice & lattice() const
The super lattice.
const SuperNeighborList & nlist() const
Returns the SuperNeighborList.
void set_primclex(PrimClex const *primclex_ptr) const
Use while transitioning Supercell to no longer need a PrimClex const *
Index volume() const
Return number of primitive cells that fit inside of *this.
const Structure & prim() const
const SupercellSymInfo & sym_info() const
permute_const_iterator translate_end() const
End PermuteIterator over pure translational permutations.
permute_const_iterator permute_end() const
permute_const_iterator permute_begin() const
permute_const_iterator translate_begin() const
Begin PermuteIterator over pure translational permutations / Equivalent to permute_begin()
const vector_type & tau() const
Const access of the cartesian translation vector, 'tau'.
Lattice reduced_cell() const
Find the lattice vectors which give most compact unit cell Compactness is measured by how close lat_c...
Lattice & make_right_handed()
Flip c vector if it's on the wrong side of a-b plane – return (*this)
Class representing a Molecule.
double reference_energy(const Configuration &config)
Returns the reference energy, normalized per unit cell.
bool has_relaxed_magmom(const Configuration &_config)
Eigen::MatrixXd relaxed_forces(const Configuration &_config)
relaxed forces of configuration, determined from DFT (eV/Angstr.), as a 3xN matrix
bool has_volume_relaxation(const Configuration &_config)
double formation_energy(const Configuration &config)
Returns the formation energy, normalized per unit cell.
bool has_reference_energy(const Configuration &_config)
double formation_energy_per_species(const Configuration &config)
Returns the formation energy, normalized per species.
double clex_formation_energy_per_species(const Configuration &config)
Returns the formation energy, normalized per species.
double atomic_deformation(const Configuration &_config)
Cost function that describes the degree to which basis sites have relaxed.
Eigen::VectorXi num_each_molecule(const ConfigDoF &configdof, const Supercell &scel)
Returns num_each_molecule(molecule_type), where 'molecule_type' is ordered as Structure::get_struc_mo...
Eigen::VectorXd correlations(const Configuration &config, Clexulator const &clexulator)
Returns correlations using 'clexulator'.
double clex_formation_energy(const Configuration &config)
Returns the formation energy, normalized per unit cell.
Eigen::VectorXd corr_contribution(Index linear_unitcell_index, const Configuration &config, Clexulator const &clexulator)
Returns correlation contribution from a single unit cell, not normalized.
Eigen::VectorXd comp(const Configuration &config)
Returns parametric composition, as calculated using PrimClex::param_comp.
Configuration closest_setting(const Configuration &_config1, const Configuration &_config2)
Configuration sub_configuration(std::shared_ptr< Supercell const > sub_scel_ptr, const Configuration &super_config, const UnitCell &origin=UnitCell(0, 0, 0))
Returns the sub-configuration that fills a particular Supercell.
double rms_force(const Configuration &_config)
Root-mean-square forces of relaxed configurations, determined from DFT (eV/Angstr....
bool has_lattice_deformation(const Configuration &_config)
bool has_rms_force(const Configuration &_config)
double n_species(const Configuration &config)
Returns the total number species per unit cell.
bool is_primitive(const Configuration &_config)
returns true if _config describes primitive cell of the configuration it describes
double volume_relaxation(const Configuration &_config)
Change in volume due to relaxation, expressed as the ratio V/V_0.
double reference_energy_per_species(const Configuration &config)
Returns the reference energy, normalized per species.
Eigen::MatrixXd gradcorrelations(const Configuration &config, Clexulator const &clexulator, DoFKey &key)
Returns gradient correlations using 'clexulator', with respect to DoF 'dof_type'.
Eigen::VectorXd comp_n(const Configuration &config)
Returns the composition, as number of each species per unit cell.
IntegralCluster config_diff(const Configuration &_config1, const Configuration &_config2)
Returns an Integral Cluster representing the perturbed sites between the configs.
double relaxed_magmom(const Configuration &_config)
Returns the relaxed magnetic moment, normalized per unit cell.
Eigen::VectorXd site_frac(const Configuration &config)
Returns the composition as site fraction, in the order of Structure::get_struc_molecule.
Configuration make_configuration(const PrimClex &primclex, std::string name)
Make Configuration from name string.
double lattice_deformation(const Configuration &_config)
Cost function that describes the degree to which lattice has relaxed.
double energy(const Configuration &config)
Returns the energy, normalized per unit cell.
double n_vacancy(const Configuration &config)
Returns the vacancy composition, as number per unit cell.
Configuration config_clip(const Configuration &_config, const Configuration &_bg, IntegralCluster &_clust)
Returns a Configuration with the sites in _clust clipped from _config and placed in _bg.
Eigen::VectorXd point_corr(Index linear_unitcell_index, Index neighbor_index, const Configuration &config, Clexulator const &clexulator)
Returns point correlations from a single site, normalized by cluster orbit size.
double energy_per_species(const Configuration &config)
Returns the energy, normalized per species.
bool has_formation_energy(const Configuration &_config)
Eigen::VectorXd species_frac(const Configuration &config)
Returns the composition as species fraction, with [Va] = 0.0, in the order of Structure::get_struc_mo...
bool has_atomic_deformation(const Configuration &_config)
bool is_canonical(const Configuration &_config)
returns true if no symmetry transformation applied to _config will increase its lexicographic order
bool has_relaxed_mag_basis(const Configuration &_config)
double relaxed_magmom_per_species(const Configuration &_config)
Returns the relaxed magnetic moment, normalized per species.
bool has_energy(const Configuration &_config)
std::string to_string(ENUM val)
Return string representation of enum class.
Eigen::CwiseUnaryOp< decltype(Local::iround_l< typename Derived::Scalar >), const Derived > iround(const Eigen::MatrixBase< Derived > &val)
Round Eigen::MatrixXd to Eigen::MatrixXi.
bool is_vacancy(const std::string &name)
A vacancy is any Specie/Molecule with (name == "VA" || name == "va" || name == "Va")
std::string const & name() const
Designated name of Molecule (may be unrelated to constituent species)
DB::Database< T > & db() const
ProjectSettings & settings()
ECIContainer const & eci(const ClexDescription &key) const
Clexulator clexulator(std::string const &basis_set_name) const
const PrimType & prim() const
const Access to primitive Structure
std::vector< std::string > struc_molecule_name(BasicStructure const &_struc)
Returns an Array of each possible Molecule in this Structure.
std::shared_ptr< Supercell > make_shared_supercell(const PrimClex &primclex, std::string name)
std::string scelname(const Structure &prim, const Lattice &superlat)
Make supercell name name [deprecated].
Supercell & apply(const SymOp &op, Supercell &scel)
Apply symmetry operation to Supercell.
ConfigIO::GenericConfigFormatter< jsonParser > config()
ConfigIO::GenericConfigFormatter< std::string > configname()
Constructs DataFormmaterDictionary containing all Configuration DatumFormatters.
Configuration in_canonical_supercell(Configuration const &configuration, Database< Supercell > &supercell_db)
Returns the canonical form Configuration in the canonical Supercell.
ConfigInsertResult make_canonical_and_insert(Configuration const &configuration, Database< Supercell > &supercell_db, Database< Configuration > &configuration_db, bool primitive_only)
Insert this configuration (in primitive & canonical form) in the database.
GenericVectorXdScelFormatter lattice()
bool is_equivalent(const Lattice &ref_lattice, const Lattice &other)
Check if ref_lattice = other*U, where U is unimodular.
Lattice replace_vector(const Lattice &lat, const Eigen::Vector3d &new_vector, double tol)
std::pair< OpIterator, Eigen::Matrix3d > is_equivalent_superlattice(const Object &scel, const Object &unit, OpIterator begin, OpIterator end, double tol)
std::ostream & operator<<(std::ostream &_stream, const FormattedPrintable &_formatted)
Configuration fill_supercell(Configuration const &motif, std::shared_ptr< Supercell const > const &shared_supercell)
SymGroup make_sym_group(const PermuteIteratorContainer &container, const Lattice &supercell_lattice)
Returns a SymGroup generated from a container of PermuteIterator.
MappingNode copy_apply(PermuteIterator const &_it, MappingNode const &_node, bool transform_cost_mat=true)
Reorders the permutation and compounds the spatial isometry (rotation.
GenericConfigCompare< Configuration, ConfigIsEquivalent > ConfigCompare
DoFSpecsType const & get(DoFKey const &key, BasisFunctionSpecs const &basis_function_specs)
GenericDatumFormatter< std::string, DataObject > name()
Iterator find(Iterator begin, Iterator end, const T &value, BinaryCompare q)
Equivalent to std::find(begin, end, value), but with custom comparison.
bool contains(const Container &container, const T &value)
Equivalent to container.end() != std::find(container.begin(), container.end(), value)
ConfigDoF make_configdof(Structure const &prim, Index volume)
Construct zero-valued ConfigDoF.
std::vector< std::vector< Index > > make_index_converter(const Structure &struc, std::vector< xtal::Molecule > mol_list)
T * end_ptr(std::vector< T > &container)
Return pointer one past end of vector. Equivalent to convainer.data()+container.size()
INDEX_TYPE Index
For long integer indexing:
Holds results of Configuration::insert.
std::map< std::string, Eigen::MatrixXd > site
Operations that transform a canonical primitive configuration to any equivalent.
Configuration prim_canon_config
PermuteIterator from_canonical_config
Eigen::Matrix3i transf_mat
RefToCanonicalPrim(const Configuration &_config)
Get operations that transform canonical primitive to this.