15 using Eigen::MatrixXcd;
25 template<
typename ClustType>
26 class GenericOrbitree;
34 template<
typename ClustType>
35 class GenericOrbitree :
public Array< GenericOrbitBranch<ClustType> > {
37 using Array< GenericOrbitBranch<ClustType> >
:: size;
38 using Array< GenericOrbitBranch<ClustType> >
:: at;
39 using Array< GenericOrbitBranch<ClustType> >
:: back;
40 using Array< GenericOrbitBranch<ClustType> > :: operator[];
147 Index find(
const ClustType &test_clust)
const;
152 bool contains(
const ClustType &test_clust);
187 void print(std::ostream &stream)
const;
223 bool verbose =
false);
249 template<
typename ClustType>
250 std::ostream &operator<< (std::ostream &stream, const GenericOrbitree<ClustType> &orbitree);
260 template<
typename ClustType>
262 tree.from_json(json);
278 template<
typename OutputIterator,
typename TreeType,
typename StrucType>
281 for(
int nc = 0; nc < tree[nb][no].size(); ++nc) {
282 const auto &clust = tree[nb][no][nc];
285 std::vector<UnitCellCoord> coord;
286 for(
int ns_i = 0; ns_i < clust.size(); ++ns_i) {
287 coord.emplace_back(clust[ns_i], struc, tol);
291 for(
int ns_i = 0; ns_i < coord.size(); ++ns_i) {
292 for(
int ns_j = 0; ns_j < coord.size(); ++ns_j) {
293 *result++ =
UnitCellCoord(coord[ns_j].sublat(), coord[ns_j].unitcell() - coord[ns_i].unitcell());
313 template<
typename OutputIterator,
typename TreeType,
typename StrucType>
314 OutputIterator
neighborhood(OutputIterator result,
const TreeType &tree,
const StrucType &struc,
double tol) {
316 for(
int nb = 0; nb < tree.size(); ++nb) {
317 for(
int no = 0; no < tree[nb].size(); ++no) {
void print_eci_in(std::ostream &out) const
Array< Array< int > > index
Array< Array< int > > subcluster
void generate_decorated_orbitree(const GenericOrbitree< ClustType > &in_tree, const SymGroup &symgroup, PERIODICITY_TYPE ptype, bool full_decor=false)
void apply_sym(const SymOp &op)
void from_json(ClexDescription &desc, const jsonParser &json)
void generate_in_cell(const Structure &prim, const Lattice &cell, int num_images=0)
void write_proto_clust(std::string file) const
Array< int > index_to_row
void set_lattice(const Lattice &new_lat, COORD_TYPE mode)
sets lattice=new_lat and also updates all OrbitBranches, Orbits, and Clusters
void get_clusters_by_site(const GenericOrbitree< ClustType > &in_tree, GenericOrbitree< ClustType > &out_tree, int num_sites)
void read(std::istream &stream, int num_sites, COORD_TYPE mode)
Structure specifies the lattice and atomic basis of a crystal.
void generate_orbitree_neighbour(const Structure &prim, const Array< int > maxNeighbour)
void read_CSPECS(std::istream &stream)
void generate_hop_orbitree(const GenericOrbitree< SiteCluster > &in_tree, const Structure &prim)
GenericOrbitree< ClustType > & operator=(const GenericOrbitree< ClustType > &RHS)
void write_full_clust(std::string file) const
Index find(const ClustType &test_clust) const
If cluster/orbit exists in current orbitree, return its linear index; else, return number of orbits i...
void push_back(const GenericOrbit< ClustType > &new_orbit)
void generate_local_orbitree(const Structure &prim, const PhenomType &tmp_phenom_clust, bool include_phenom_clust_sites)
Constructs a local orbitree about a Phenom Cluster, given a Structure.
void get_index() const
Populates 'index', 'index_to_row' and 'index_to_column' Arrays.
void print_proto_clust_funcs(std::ostream &out) const
Array< Array< Index > > m_b2asym
void get_dynamical_matrix(MatrixXcd &dmat, const Coordinate &k, Index bands_per_site)
Index basis_set_size() const
Count number of basis functions at each orbit and sum result.
SymGroup is a collection of symmetry operations that satisfy the group property The symmetry operatio...
GenericOrbitree< SiteCluster > SiteOrbitree
bool read_custom_clusters_from_json(const jsonParser &json, const Structure &struc, const SymGroup &sym_group, bool verbose=false)
Add more orbits to Orbitree based on JSON input.
void print_proto_clust(std::ostream &out) const
const GenericOrbitBranch< ClustType > & _asym_unit() const
SymOp is the Coordinate representation of a symmetry operation it keeps fraction (FRAC) and Cartesian...
void resize(Index NP)
Initialize NP orbitbranches in the Orbitree. Any existing orbits get deleted.
void write_full_decorated_clust(std::string file) const
Represents cartesian and fractional coordinates.
void collect_basis_info(const Structure &struc)
EigenIndex Index
For long integer indexing:
GenericOrbitBranch< ClustType > m_asym_unit
OutputIterator neighborhood(OutputIterator result, const TreeType &tree, const StrucType &struc, double tol)
Iterate over all sites in an orbitree and insert a UnitCellCoord.
void print_full_basis_info(std::ostream &out) const
void _populate_site_bases()
void set_bspecs(const jsonParser &_bspecs)
Array< int > num_clusts
we don't use num_clusts yet. It might be a better way to specify how many clusters to enumerate ...
void print_proto_decorated_clust(std::ostream &out) const
void get_s2s_vec()
Call get_s2s_vec on all clusters in orbitree.
void write_eci_in(std::string filename) const
Array< int > index_to_column
GenericOrbitBranch< ClustType > & at(Index ind)
double tol() const
Access orbitree tolerance.
void generate_orbitree_from_proto_file(std::string filename, const SymGroup &sym_group, PERIODICITY_TYPE ptype)
void print_full_clust(std::ostream &out) const
void _generate_asym_unit(const Structure &prim)
void sort()
Calls 'sort()' on each OrbitBranch to sort Orbits by lengthscale.
void generate_orbitree(const Structure &prim, bool verbose=false)
const ClustType & prototype(Index np, Index no) const
Access prototype of orbit (np, no)
const ClustType & equiv(Index np, Index no, Index ne) const
Access equivalent cluster 'ne' of orbit (np, no)
void read_orbitree_from_json(const std::string &json_file_name, const SymGroup &sym_group, const Structure &ref_struc)
void generate_orbitree_TB(const Structure &prim)
void from_json(const jsonParser &json)
Assumes the pivot lattice is already set.
Array< double > max_length
void write_proto_decorated_clust(std::string file) const
GenericOrbit< ClustType > & orbit(Index np, Index no)
Access orbits using 2-D indexing.
void print_full_decorated_clust(std::ostream &out) const
void trans_and_expand(const Array< Coordinate > &prim_grid, bool override=0)
void get_hierarchy() const
void generate_clust_bases(std::vector< BasisSet const * > const &global_args, Index max_poly_order=-1)
get clust_basis for all equivalent clusters
GenericOrbitBranch< ClustType > & back()
OutputIterator orbit_neighborhood(OutputIterator result, const TreeType &tree, const StrucType &struc, Index nb, Index no, double tol)
Iterate over all sites in an orbit and insert a UnitCellCoord.
GenericOrbitree< HopCluster > HopOrbitree
bool contains(const ClustType &test_clust)
If cluster exists in current orbitree, return true.
void print(std::ostream &stream) const
const GenericOrbitBranch< ClustType > & asym_unit() const
void add_subclusters(const ClustType &big_clust, const Structure &prim, bool verbose=false)
Adding in subclusters of a specific cluster into *this Orbitree.
const jsonParser & bspecs() const