CASM  1.1.0
A Clusters Approach to Statistical Mechanics
StrucMapping.hh
Go to the documentation of this file.
1 #ifndef CASM_StrucMapping
2 #define CASM_StrucMapping
3 
4 #include <unordered_set>
5 #include <vector>
6 
12 #include "casm/external/Eigen/Core"
15 #include "casm/misc/CASM_math.hh"
17 
18 namespace CASM {
19 namespace xtal {
20 class Lattice;
21 class LatticeMap;
22 class SimpleStructure;
23 class StrucMapCalculatorInterface;
24 
25 // In this file:
26 struct LatticeNode;
27 struct AssignmentNode;
28 struct MappingNode;
29 class StrucMapper;
30 
31 namespace StrucMapping {
32 
33 typedef std::vector<std::vector<Index>> PermuteOpVector;
35 inline double big_inf() { return 10E20; }
36 
39 inline double small_inf() { return 10E10; }
40 
41 inline bool is_inf(double _val) { return _val > small_inf() / 2.; }
42 
51 double atomic_cost_child(const MappingNode &mapped_result, Index Nsites);
52 
61 double atomic_cost_parent(const MappingNode &mapped_result, Index Nsites);
62 
65 double atomic_cost(const MappingNode &mapped_config, Index Nsites);
66 
68 double atomic_cost(
69  const MappingNode &basic_mapping_node, SymOpVector &factor_group,
70  const std::vector<Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic,
71  Index>> &permutation_group,
72  Index Nsites);
73 
74 } // namespace StrucMapping
75 
82 struct LatticeNode {
88 
92 
110 
129 
131  double cost;
132 
140  LatticeNode(Lattice const &parent_prim, Lattice const &parent_scel,
141  Lattice const &child_prim, Lattice const &child_scel,
142  Index child_N_atom, double _cost = StrucMapping::big_inf());
143 
149  LatticeNode(LatticeMap const &_lat_map, Lattice const &parent_prim,
150  Lattice const &child_prim);
151 };
152 
155 bool less(LatticeNode const &A, LatticeNode const &B, double cost_tol);
156 
159 bool identical(LatticeNode const &A, LatticeNode const &B, double cost_tol);
160 
167  AssignmentNode(double _cost_tol = 1e-6)
168  : time_reversal(false), cost(0), m_cost_tol(_cost_tol) {}
169 
177  Eigen::Vector3d translation;
178 
181 
185  std::set<std::pair<Index, Index>> forced_on;
186 
192  std::vector<Index> irow;
193 
199  std::vector<Index> icol;
200 
204  std::vector<Index> assignment;
205 
216 
219  double cost;
220 
221  double cost_tol() const { return m_cost_tol; }
222 
224  bool empty() const { return cost_mat.size() == 0 && assignment.empty(); }
225 
229  bool operator<(AssignmentNode const &other) const;
230 
235  std::vector<Index> permutation() const {
236  std::vector<Index> result(assignment.size() + forced_on.size(), 0);
237  for (auto const &pair : forced_on) {
238  result[pair.first] = pair.second;
239  }
240  for (Index i = 0; i < assignment.size(); ++i) {
241  result[irow[i]] = icol[assignment[i]];
242  }
243  return result;
244  }
245 
246  private:
247  double m_cost_tol;
248 };
249 
251 bool identical(AssignmentNode const &A, AssignmentNode const &B);
252 
255 struct MappingNode {
256  // typedefs to provide flexibility if we eventually change to a
257  // Eigen::Matrix<3,Eigen::Dynamic>
259 
260  // Can treat as a Eigen::VectorXd
261  using Displacement = DisplacementMatrix::ColXpr;
262  using ConstDisplacement = DisplacementMatrix::ConstColXpr;
263 
264  // Label molecules as name and occupant index (optional, default 0)
265  using MoleculeLabel = std::pair<std::string, Index>;
266 
267  using AtomIndexSet = std::set<Index>;
268 
269  using MoleculeMap = std::vector<AtomIndexSet>;
270 
275 
278  bool is_viable;
279 
282  mutable bool is_valid;
283 
286  mutable bool is_partitioned;
287 
291  double cost;
292 
296 
303  std::vector<Index> atom_permutation;
304 
308 
310  std::vector<MoleculeLabel> mol_labels;
311 
314  static MappingNode invalid();
315 
318  MappingNode(LatticeNode _lattice_node, double _lattice_weight)
319  : lattice_node(std::move(_lattice_node)),
320  is_viable(true),
321  is_valid(false),
322  is_partitioned(false) {
323  set_lattice_weight(_lattice_weight);
325  }
326 
327  double cost_tol() const { return atomic_node.cost_tol(); }
328 
333  void set_lattice_weight(double _lw) {
334  lattice_weight = max(min(_lw, 1.0), 1e-9);
336  }
337 
340  std::pair<Index, Index> vol_pair() const {
341  return std::pair<Index, Index>(lattice_node.parent.size(),
343  }
344 
347  void calc();
348 
349  void clear() {
350  throw std::runtime_error("MappingNode::clear() not implemented");
351  }
352 
354  Eigen::Matrix3d const &isometry() const { return lattice_node.isometry; }
355 
357  Eigen::Matrix3d const &stretch() const { return lattice_node.stretch; }
358 
360  Eigen::Vector3d const &translation() const { return atomic_node.translation; }
361 
363  bool time_reversal() const { return atomic_node.time_reversal; }
364 
366  Displacement disp(Index i) { return atom_displacement.col(i); }
367 
369  ConstDisplacement disp(Index i) const { return atom_displacement.col(i); }
370 
378  bool operator<(MappingNode const &other) const;
379 };
380 
382 inline Eigen::Matrix3d const &get_matrix(MappingNode const &_node) {
383  return _node.isometry();
384 }
385 
388 inline Eigen::Vector3d const &get_translation(MappingNode const &_node) {
389  return _node.translation();
390 }
391 
394 inline bool get_time_reversal(MappingNode const &_node) {
395  return _node.time_reversal();
396 }
397 
404 class StrucMapper {
405  public:
406  using LatMapType = std::map<Index, std::vector<Lattice>>;
407 
408  enum Options {
409  none = 0,
410  strict = (1u << 0),
411  robust = (1u << 1),
412  sym_strain = (1u << 2),
413  sym_basis = (1u << 3),
414  // soft_va_limit ensures that if no supercell volume satisfies vacancy
415  // constraints, the smallest possible volume is used. Default behavior
416  // results in no valid mapping
417  soft_va_limit = (1u << 4)
418  };
419 
468  StrucMapper(StrucMapCalculatorInterface const &_calculator,
469  double _lattice_weight = 0.5, double _max_volume_change = 0.5,
470  int _options = 0, // this should actually be a bitwise-OR of
471  // StrucMapper::Options
472  double _cost_tol = TOL, double _min_va_frac = 0.,
473  double _max_va_frac = 1.);
474 
476  double cost_tol() const { return m_cost_tol; }
477 
480  double xtal_tol() const { return m_xtal_tol; }
481 
482  double lattice_weight() const { return m_lattice_weight; }
483 
484  double atomic_weight() const { return 1. - m_lattice_weight; }
485 
486  void set_lattice_weight(double _lw) {
487  m_lattice_weight = max(min(_lw, 1.0), 1e-9);
488  }
489 
494  }
495 
499  m_lattice_transformation_range = _new_range;
500  }
501 
506  void set_symmetrize_lattice_cost(bool _sym_lat_cost) {
507  m_symmetrize_lattice_cost = _sym_lat_cost;
508  }
509 
515  bool _sym_atomic_cost, const SymOpVector &factor_group,
516  const std::vector<Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic,
517  Index>> &permutation_group) {
518  m_symmetrize_atomic_cost = _sym_atomic_cost;
519  m_calc_ptr->set_sym_invariant_displacement_modes(
520  generate_invariant_shuffle_modes(factor_group, permutation_group));
521  }
522 
525 
530  double min_va_frac() const { return m_min_va_frac; }
531 
536  void set_min_va_frac(double _min_va) { m_min_va_frac = max(_min_va, 0.); }
537 
542  double max_va_frac() const { return m_max_va_frac; }
543 
548  void set_max_va_frac(double _max_va) { m_max_va_frac = min(_max_va, 0.99); }
549 
551  int options() const { return m_options; }
552 
554  SimpleStructure const &parent() const;
555 
557  void add_allowed_lattice(Lattice const &_lat) {
559  [std::abs(round(volume(_lat) / parent().lat_column_mat.determinant()))]
560  .push_back(_lat);
561  }
562 
566 
569  bool lattices_constrained() const { return m_allowed_superlat_map.size(); }
570 
577  std::function<bool(Lattice const &, Lattice const &)> _filter_f) {
578  m_filtered = true;
579  m_filter_f = _filter_f;
580  m_superlat_map.clear();
581  }
582 
584  void unset_filter() {
585  m_filtered = false;
586  m_superlat_map.clear();
587  }
588 
603  std::set<MappingNode> map_ideal_struc(
604  const SimpleStructure &child_struc, Index k = 1,
605  double max_cost = StrucMapping::big_inf(), double min_cost = -TOL,
606  bool keep_invalid = false) const;
607 
622  std::set<MappingNode> map_deformed_struc(
623  const SimpleStructure &child_struc, Index k = 1,
624  double max_cost = StrucMapping::big_inf(), double min_cost = -TOL,
625  bool keep_invalid = false,
626  SymOpVector const &child_factor_group = {SymOp::identity()}) const;
627 
643  std::set<MappingNode> map_deformed_struc_impose_lattice_vols(
644  const SimpleStructure &child_struc, Index min_vol, Index max_vol,
645  Index k = 1, double max_cost = StrucMapping::big_inf(),
646  double min_cost = -TOL, bool keep_invalid = false,
647  SymOpVector const &child_factor_group = {SymOp::identity()}) const;
648 
666  std::set<MappingNode> map_deformed_struc_impose_lattice(
667  const SimpleStructure &child_struc, const Lattice &imposed_lat,
668  Index k = 1, double max_cost = StrucMapping::big_inf(),
669  double min_cost = -TOL, bool keep_invalid = false,
670  SymOpVector const &child_factor_group = {SymOp::identity()}) const;
671 
680 
691  std::set<MappingNode> map_deformed_struc_impose_lattice_node(
692  const SimpleStructure &child_struc, const LatticeNode &imposed_node,
693  Index k = 1, double max_cost = StrucMapping::big_inf(),
694  double min_cost = -TOL, bool keep_invalid = false) const;
695 
704 
731  Index k_best_maps_better_than(SimpleStructure const &child_struc,
732  std::set<MappingNode> &queue, Index k = 1,
733  double max_cost = StrucMapping::big_inf(),
734  double min_cost = -TOL,
735  bool keep_invalid = false,
736  bool keep_tail = false,
737  bool no_partiton = false) const;
738 
740 
741  private:
751  std::set<MappingNode> _seed_k_best_from_super_lats(
752  SimpleStructure const &child_struc,
753  std::vector<Lattice> const &_parent_scels,
754  std::vector<Lattice> const &_child_scels, Index k, double max_strain_cost,
755  double min_strain_cost,
756  SymOpVector const &child_factor_group = {SymOp::identity()}) const;
757 
761  std::set<MappingNode> _seed_from_vol_range(
762  SimpleStructure const &child_struc, Index k, Index min_vol, Index max_vol,
763  double max_strain_cost, double min_strain_cost,
764  SymOpVector const &child_factor_group = {SymOp::identity()}) const;
765 
769  Index _n_species(SimpleStructure const &sstruc) const;
770 
771  // Implement filter as std::function<bool(Lattice const&,Lattice const&)>
772  bool _filter_lat(Lattice const &_parent_lat,
773  Lattice const &_child_lat) const {
774  return m_filter_f(_parent_lat, _child_lat);
775  }
776 
777  std::pair<Index, Index> _vol_range(const SimpleStructure &child_struc) const;
778 
780 
782 
786  double m_cost_tol;
787  double m_xtal_tol;
790 
792 
795 
797  std::function<bool(Lattice const &, Lattice const &)> m_filter_f;
798 
802 
803  std::vector<Lattice> _lattices_of_vol(Index prim_vol) const;
804 };
805 
806 } // namespace xtal
807 } // namespace CASM
808 #endif
Representation of a crystal of molecular and/or atomic occupants, and any additional properties....
bool lattices_constrained() const
returns true if the search of parent superlattices is constrained to a pre-specified list
double atomic_weight() const
double max_va_frac() const
Returns the maximum fraction of sites allowed to be vacant in the mapping relation Vacancy fraction i...
std::set< MappingNode > _seed_from_vol_range(SimpleStructure const &child_struc, Index k, Index min_vol, Index max_vol, double max_strain_cost, double min_strain_cost, SymOpVector const &child_factor_group={SymOp::identity()}) const
construct partial mapping nodes (with uninitialized atomic_node) based on current settings considers ...
bool symmetrize_atomic_cost() const
notstd::cloneable_ptr< StrucMapCalculatorInterface > m_calc_ptr
void set_max_va_frac(double _max_va)
Sets the maximum fraction of sites allowed to be vacant in the mapping relation Vacancy fraction is u...
std::set< MappingNode > map_ideal_struc(const SimpleStructure &child_struc, Index k=1, double max_cost=StrucMapping::big_inf(), double min_cost=-TOL, bool keep_invalid=false) const
k-best mappings of ideal child structure onto parent structure Assumes that child_struc and parent_st...
Index lattice_transformation_range() const
Max element considered for integer unimodular matrix transformations (which define orientation relati...
std::set< MappingNode > map_deformed_struc_impose_lattice(const SimpleStructure &child_struc, const Lattice &imposed_lat, Index k=1, double max_cost=StrucMapping::big_inf(), double min_cost=-TOL, bool keep_invalid=false, SymOpVector const &child_factor_group={SymOp::identity()}) const
k-best mappings of arbitrary child structure onto parent structure imposes simplifying assumption tha...
bool symmetrize_lattice_cost() const
bool _filter_lat(Lattice const &_parent_lat, Lattice const &_child_lat) const
StrucMapCalculatorInterface const & calculator() const
std::pair< Index, Index > _vol_range(const SimpleStructure &child_struc) const
int options() const
returns bit flag of selected options for this StrucMapper
LatMapType m_allowed_superlat_map
LatMapType m_superlat_map
Maps the supercell volume to a vector of Lattices with that volume.
void add_allowed_lattice(Lattice const &_lat)
specify a superlattice of the parent to be searched during mapping
void set_symmetrize_lattice_cost(bool _sym_lat_cost)
Flag that enables the calculation of a symmetrized lattice cost when performing the lattice maps....
std::function< bool(Lattice const &, Lattice const &)> m_filter_f
std::set< MappingNode > _seed_k_best_from_super_lats(SimpleStructure const &child_struc, std::vector< Lattice > const &_parent_scels, std::vector< Lattice > const &_child_scels, Index k, double max_strain_cost, double min_strain_cost, SymOpVector const &child_factor_group={SymOp::identity()}) const
generate list of partial mapping seeds (i.e., LatticeNode only) from a list of supercells of the pare...
std::set< MappingNode > map_deformed_struc_impose_lattice_vols(const SimpleStructure &child_struc, Index min_vol, Index max_vol, Index k=1, double max_cost=StrucMapping::big_inf(), double min_cost=-TOL, bool keep_invalid=false, SymOpVector const &child_factor_group={SymOp::identity()}) const
k-best mappings of arbitrary child structure onto parent structure imposes simplifying assumption tha...
double xtal_tol() const
Tolerance for initializing lattices. For now it is initialized to CASM::TOL.
Index _n_species(SimpleStructure const &sstruc) const
returns number of species in a SimpleStructure given the current calculator settings....
std::map< Index, std::vector< Lattice > > LatMapType
void set_lattice_weight(double _lw)
std::set< MappingNode > map_deformed_struc(const SimpleStructure &child_struc, Index k=1, double max_cost=StrucMapping::big_inf(), double min_cost=-TOL, bool keep_invalid=false, SymOpVector const &child_factor_group={SymOp::identity()}) const
k-best mappings of arbitrary child structure onto parent structure, without simplifying assumptions I...
double min_va_frac() const
Returns the minimum fraction of sites allowed to be vacant in the mapping relation Vacancy fraction i...
void set_min_va_frac(double _min_va)
Sets the minimum fraction of sites allowed to be vacant in the mapping relation Vacancy fraction is u...
StrucMapper(StrucMapCalculatorInterface const &_calculator, double _lattice_weight=0.5, double _max_volume_change=0.5, int _options=0, double _cost_tol=TOL, double _min_va_frac=0., double _max_va_frac=1.)
Construct and initialize a StrucMapper.
void set_symmetrize_atomic_cost(bool _sym_atomic_cost, const SymOpVector &factor_group, const std::vector< Eigen::PermutationMatrix< Eigen::Dynamic, Eigen::Dynamic, Index >> &permutation_group)
Flag that enables the calculation of a symmetrized atomic cost when performing the atomic maps....
SimpleStructure const & parent() const
returns reference to parent structure
void clear_allowed_lattices() const
clear the list of allowed parent superlattices; all superlattices will be generated automatically,...
void set_lattice_transformation_range(Index _new_range)
Max element considered for integer unimodular matrix transformations (which define orientation relati...
void set_filter(std::function< bool(Lattice const &, Lattice const &)> _filter_f)
specify to use filtered lattices for mapping. The filter function is of the form bool filter(parent_l...
std::set< MappingNode > map_deformed_struc_impose_lattice_node(const SimpleStructure &child_struc, const LatticeNode &imposed_node, Index k=1, double max_cost=StrucMapping::big_inf(), double min_cost=-TOL, bool keep_invalid=false) const
k-best mappings of arbitrary child structure onto parent structure imposes simplifying assumption tha...
double lattice_weight() const
double cost_tol() const
Tolerance for determining if two mapping-cost values are identical.
Index k_best_maps_better_than(SimpleStructure const &child_struc, std::set< MappingNode > &queue, Index k=1, double max_cost=StrucMapping::big_inf(), double min_cost=-TOL, bool keep_invalid=false, bool keep_tail=false, bool no_partiton=false) const
low-level function. Takes a queue of mappings and use it to seed a search for k-best total mappings....
std::vector< Lattice > _lattices_of_vol(Index prim_vol) const
Eigen::MatrixXd m_strain_gram_mat
void unset_filter()
specify not to use filtered lattice for mapping
A 'cloneable_ptr' can be used in place of 'unique_ptr'.
double volume(const Lattice &lat)
Returns the volume of a Lattice.
Definition: Lattice.hh:281
Eigen::CwiseUnaryOp< decltype(Local::round_l< typename Derived::Scalar >), const Derived > round(const Eigen::MatrixBase< Derived > &val)
Round Eigen::MatrixXd.
SharedPrimFormatter< jsonParser > factor_group()
double big_inf()
Very large value used to denote invalid or impossible mapping.
Definition: StrucMapping.hh:35
double atomic_cost_child(const MappingNode &mapped_result, Index Nsites)
Calculate the basis cost function of a MappingNode as the normalized mean-square displacement of its ...
Definition: StrucMapping.cc:33
double atomic_cost_parent(const MappingNode &mapped_result, Index Nsites)
Calculate the basis cost function of a MappingNode as the normalized mean-square displacement of its ...
Definition: StrucMapping.cc:47
bool is_inf(double _val)
Definition: StrucMapping.hh:41
double atomic_cost(const MappingNode &mapped_config, Index Nsites)
Calculate the basis cost function of a MappingNode as the average of atomic_cost_child and atomic_cos...
Definition: StrucMapping.cc:59
std::vector< std::vector< Index > > PermuteOpVector
Definition: StrucMapping.hh:33
double small_inf()
use as default value to initialize mapping costs. Does not indicate ivalidity
Definition: StrucMapping.hh:39
bool identical(LatticeNode const &A, LatticeNode const &B, double cost_tol)
returns true if cost values and parent/child supercell transformations are same for A and B
std::vector< Eigen::MatrixXd > generate_invariant_shuffle_modes(const std::vector< xtal::SymOp > &factor_group, const std::vector< Eigen::PermutationMatrix< Eigen::Dynamic, Eigen::Dynamic, Index >> &permute_group)
Eigen::Vector3d const & get_translation(MappingNode const &_node)
External accessor for translation, to provide xtal::SymOp adaptability.
bool get_time_reversal(MappingNode const &_node)
External accessor for time_reversal, to provide xtal::SymOp adaptability.
Eigen::Matrix3d const & get_matrix(MappingNode const &_node)
External accessor for isometry, to provide xtal::SymOp adaptability.
bool less(LatticeNode const &A, LatticeNode const &B, double cost_tol)
Compare two LatticeMap objects, based on their mapping cost first, followed by PrimGrid transformatio...
std::vector< SymOp > SymOpVector
Main CASM namespace.
Definition: APICommand.hh:8
Eigen::MatrixXd MatrixXd
Eigen::Matrix3d Matrix3d
const double TOL
Definition: definitions.hh:30
T min(const T &A, const T &B)
Definition: CASM_math.hh:88
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39
T max(const T &A, const T &B)
Definition: CASM_math.hh:95
Definition: stream_io.hh:24
Structure to encode the solution of a constrained atomic assignmnet problem This describes the permut...
std::vector< Index > irow
'real' indices of rows in the reduced 'cost_mat' When a site assignment {i,j} is added to forced_on,...
Eigen::Vector3d translation
Mapping translation from child to parent Defined such that translation=parent_coord....
double cost
Total cost of best solution to the constrained assignment problem having some forced_on assignments.
std::vector< Index > permutation() const
Combines constrained vector HungarianNode::assignment and HungarianNode::forced_on to obtain total pe...
bool empty() const
True if cost matrix and assignment vector are uninitialized.
bool operator<(AssignmentNode const &other) const
Compares time_reversal and translation for time_reversal, false is less than true for translation,...
std::vector< Index > assignment
Solution of the assignment problem for the reduced 'cost_mat' An assignment {k,l} in the reduced prob...
Eigen::MatrixXd cost_mat
Cost matrix for an assignment problem, which may be a reduced assignment problem if forced_on....
std::vector< Index > icol
'real' indices of columns in the reduced 'cost_mat' When a site assignment {i,j} is added to forced_o...
std::set< std::pair< Index, Index > > forced_on
parent->child site assignments that have been forced on at this node for element 'el' such that force...
bool time_reversal
time_reversal relationship between child and parent
AssignmentNode(double _cost_tol=1e-6)
Class describing the lattice-mapping portion of a particular mapping A general map for child_struc on...
Definition: StrucMapping.hh:82
LatticeNode(Lattice const &parent_prim, Lattice const &parent_scel, Lattice const &child_prim, Lattice const &child_scel, Index child_N_atom, double _cost=StrucMapping::big_inf())
Construct with ideal parent_scel and deformed child_scel, which are related by a deformation tensor.
double cost
strain_cost of the LatticeNode
Superlattice parent
PrimGrid for supercell of parent structure The parent structure defines the ideal strain state,...
Superlattice child
PrimGrid for supercell of child structure The child lattice is recorded in its idealized state (de-ro...
Eigen::Matrix3d stretch
stretch tensor that takes child superlattice from its de-rotated, deformed state to its ideal,...
Definition: StrucMapping.hh:87
Eigen::Matrix3d isometry
cartesian rotation/reflection/rotoreflection that rotates the child superlattice to its de-rotated,...
Definition: StrucMapping.hh:91
ConstDisplacement disp(Index i) const
const access i'th atomic displacement of mapped structure
Eigen::MatrixXd DisplacementMatrix
void calc()
non-const calc method solves the assignment problem via hungarian_method sets is_viable -> false if n...
bool operator<(MappingNode const &other) const
static MappingNode invalid()
Static constructor to build an invalid MappingNode, can be used as return value when no valid mapping...
DisplacementMatrix::ConstColXpr ConstDisplacement
MappingNode(LatticeNode _lattice_node, double _lattice_weight)
construct with lattice node and lattice_weight. Cost is initialized assuming zero atomic_node cost
AssignmentNode atomic_node
Eigen::Vector3d const & translation() const
convenience method to access MappingNode::atomic_node.translation
std::vector< AtomIndexSet > MoleculeMap
Displacement disp(Index i)
non-const access of i'th atomic displacement of mapped structure
std::vector< Index > atom_permutation
std::pair< Index, Index > vol_pair() const
Return pair of integer volumes {Vp, Vc}, where Vp is parent supercell volume and Vc is child supercel...
bool time_reversal() const
convenience method to access MappingNode::atomic_node.time_reveral
Eigen::Matrix3d const & stretch() const
convenience method to access MappingNode::lattice_node.stretch
bool is_partitioned
true if node has been partitioned into sub-nodes for generalized k-best assignment problem – default ...
Eigen::MatrixXd atom_displacement
3xN matrix of displacements for all sites in parent supercell (Va are included, but set to Zero)
DisplacementMatrix::ColXpr Displacement
bool is_viable
true if assignment problem is not yet known to be insoluable – default true
std::set< Index > AtomIndexSet
std::vector< MoleculeLabel > mol_labels
list of assigned molecule names
double cost
total, finalized cost, populated by a StrucMapCalculator. Not guaranteed to be a linear function of l...
std::pair< std::string, Index > MoleculeLabel
double cost_tol() const
bool is_valid
true if assignment has been checked for physical validity and passes – default false
Eigen::Matrix3d const & isometry() const
convenience method to access MappingNode::lattice_node.isometry
void set_lattice_weight(double _lw)
set the lattice_weight. Cost is calculated as cost = lattice_weight*lattice_node.cost + atomic_weight...
static SymOp identity()
Definition: SymType.hh:29