Psi4
libmints/molecule.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License along
22  * with this program; if not, write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  *
25  * @END LICENSE
26  */
27 
28 #ifndef _psi_src_lib_libmints_molecule_h_
29 #define _psi_src_lib_libmints_molecule_h_
30 
31 #include <vector>
32 #include <string>
33 #include <cstdio>
34 #include <map>
35 #include <memory>
36 
37 #include "psi4/pybind11.h"
38 
39 #define LINEAR_A_TOL 1.0E-2 //When sin(a) is below this, we consider the angle to be linear
40 #define DEFAULT_SYM_TOL 1.0E-8
41 #define FULL_PG_TOL 1.0e-8 // default
42 
43 #include "typedefs.h"
44 #include "coordentry.h"
45 
46 namespace psi {
47 class PointGroup;
48 
52 
53 const std::string RotorTypeList[] = {"ASYMMETRIC_TOP", "SYMMETRIC_TOP",
54  "SPHERICAL_TOP", "LINEAR", "ATOM"};
55 
56 const std::string FullPointGroupList[] = {"ATOM", "C_inf_v", "D_inf_h", "C1", "Cs", "Ci", "Cn", "Cnv",
57  "Cnh", "Sn", "Dn", "Dnd", "Dnh", "Td", "Oh", "Ih"};
58 
63 class Molecule
64 {
65 public:
72  };
80  enum FragmentType {
82  Real,
84  };
85 
87  QMatom = 1,
88  EFPatom = 2,
89  ALLatom = 3
90  };
91 
92  typedef std::vector<std::shared_ptr<CoordEntry> > EntryVector;
93  typedef EntryVector::iterator EntryVectorIter;
94 
95 protected:
97  std::string name_;
103  std::vector<int> fragment_charges_;
105  std::vector<int> fragment_multiplicities_;
106 
111 
125  std::vector<std::string> all_variables_;
127  void clear();
128 
135  CoordValue* get_coord_value(const std::string &str);
136 
144  int get_anchor_atom(const std::string &str, const std::string &line);
145 
147  std::shared_ptr<PointGroup> pg_;
152 
154  int nunique_;
156  int *nequiv_;
158  int **equiv_;
161 
163  std::map<std::string, double> geometry_variables_;
165  std::vector<FragmentType> fragment_types_;
166 //****AVC****//
167 // moved fragments_ to public
168 // moved fragment_levels_ to public
169 //****AVC****//
171  std::string symmetry_from_input_;
178  bool zmat_;
179 
180 public:
181 //****AVC****//
183  std::vector<std::pair<int, int> > fragments_;
184 //****AVC****//
185 
186  Molecule();
188  Molecule(const Molecule& other);
189  virtual ~Molecule();
190 
191  Molecule clone(void) {
192  Molecule new_obj(*this);
193  return new_obj;
194  }
195 
199  Molecule& operator=(const Molecule& other);
201  Molecule operator+(const Molecule& other);
203  Molecule operator-(const Molecule& other);
205  void operator+=(const Molecule& other);
207 
208 
213  void init_with_xyz(const std::string& xyzfilename);
214 
226  void add_atom(int Z, double x, double y, double z,
227  const char *symb = "", double mass = 0.0,
228  double charge = 0.0, int lineno = -1);
229 
233  bool charge_specified() const { return charge_specified_; }
235  int nfragments() const { return fragments_.size();}
237  int nactive_fragments();
239  // Needed for EFP interface
240  std::pair<int, int> fragment_atom_pair(int f) { return fragments_[f]; }
241 
243  const std::string name() const {return name_; }
245  void set_name(const std::string &_name) { name_ = _name; }
247  int natom() const;
249  int nallatom() const { return full_atoms_.size(); }
251  const double& Z(int atom) const;
253  double fZ(int atom) const;
255  double x(int atom) const;
257  double y(int atom) const;
259  double z(int atom) const;
261  double fx(int atom) const;
263  double fy(int atom) const;
265  double fz(int atom) const;
267  Vector3 xyz(int atom) const;
268  Vector3 fxyz(int atom) const;
270  double xyz(int atom, int _xyz) const;
272  double mass(int atom) const;
273 
275  void set_mass(int atom, double mass) { full_atoms_[atom]->set_mass(mass); }
276 
278  std::string symbol(int atom) const;
280  std::string fsymbol(int atom) const;
282  std::string label(int atom) const;
284  double charge(int atom) const;
286  int true_atomic_number(int atom) const;
287  int ftrue_atomic_number(int atom) const;
289  double fmass(int atom) const;
291  std::string flabel(int atom) const;
293  double fcharge(int atom) const;
295  const std::shared_ptr<CoordEntry>& atom_entry(int atom) const;
296 
297  void set_basis_all_atoms(const std::string& name, const std::string& type="BASIS");
298  void set_basis_by_symbol(const std::string& symbol, const std::string& name, const std::string& type="BASIS");
299  void set_basis_by_number(int number, const std::string& name, const std::string& type="BASIS");
300  void set_basis_by_label(const std::string& label, const std::string& name, const std::string& type="BASIS");
301  void set_shell_by_label(const std::string& label, const std::string& name, const std::string& type="BASIS");
302 
304  int nfrozen_core(const std::string& depth = "");
305 
308  int atom_at_position1(double *, double tol = 0.05) const;
309  int atom_at_position2(Vector3&, double tol = 0.05) const;
311 
313  void set_reinterpret_coordentry(bool rc);
314 
316  Matrix geometry() const;
318  Matrix full_geometry() const;
319 
324  void set_geometry(double** geom);
325 
329  void set_geometry(const Matrix& geom);
330 
334  void set_full_geometry(double** geom);
335 
339  void set_full_geometry(const Matrix& geom);
340 
344  void rotate(const Matrix& R);
345  void rotate_full(const Matrix& R);
346 
351 
355  void reinterpret_fragments();
356 
361  void symmetrize_to_abelian_group(double tol);
362 
364  Vector3 center_of_mass() const;
366  double nuclear_repulsion_energy() const;
368  Vector3 nuclear_dipole() const;
370  Vector3 nuclear_dipole(const Vector3 &origin) const;
375 
377  double pairwise_nuclear_repulsion_energy(std::shared_ptr<Molecule> other) const;
378 
380  void translate(const Vector3& r);
382  void move_to_com();
388 // void reorient();
389 
391  Matrix distance_matrix() const;
392 
394  Matrix* inertia_tensor() const;
395 
397  Vector rotational_constants(double tol = FULL_PG_TOL) const;
398 
400  void print_rotational_constants(void) const;
402  RotorType rotor_type(double tol = FULL_PG_TOL) const;
403 
405  void print() const;
406 
408  void print_cluster() const;
409 
411  void print_full() const;
412 
414  void print_in_input_format() const;
415 
417  void print_in_bohr() const;
418 
420  void print_in_angstrom() const;
421 
423  void print_distances() const;
424  void print_bond_angles() const;
425  void print_dihedrals() const;
426  void print_out_of_planes() const;
427 
429  void save_xyz_file(const std::string & filename, bool save_ghosts = true) const;
431  std::string save_string_xyz_file() const;
432 
434  std::string save_string_xyz() const;
435 
441  int nunique() const { return nunique_; }
443  int unique(int iuniq) const { return equiv_[iuniq][0]; }
445  int nequivalent(int iuniq) const { return nequiv_[iuniq]; }
447  int equivalent(int iuniq, int j) const { return equiv_[iuniq][j]; }
450  int atom_to_unique(int iatom) const { return atom_to_unique_[iatom]; }
453  int atom_to_unique_offset(int iatom) const;
455  int max_nequivalent() const;
457 
461  bool has_symmetry_element(Vector3& op, double tol=DEFAULT_SYM_TOL) const;
462  std::shared_ptr<PointGroup> point_group() const;
463  void set_point_group(std::shared_ptr<PointGroup> pg);
465  void set_full_point_group(double tol=FULL_PG_TOL);
467  bool has_inversion(Vector3& origin, double tol=DEFAULT_SYM_TOL) const;
469  bool is_plane(Vector3& origin, Vector3& uperp, double tol=DEFAULT_SYM_TOL) const;
471  bool is_axis(Vector3& origin, Vector3& axis, int order, double tol=DEFAULT_SYM_TOL) const;
473  void is_linear_planar(bool& linear, bool& planar, double tol=DEFAULT_SYM_TOL) const;
475  std::shared_ptr<PointGroup> find_point_group(double tol=DEFAULT_SYM_TOL) const;
477  void reset_point_group(const std::string& pgname);
479  std::shared_ptr<PointGroup> find_highest_point_group(double tol=DEFAULT_SYM_TOL) const;
482  std::shared_ptr<Matrix> symmetry_frame(double tol=DEFAULT_SYM_TOL);
489  std::string sym_label();
491  char **irrep_labels();
492  const std::string& symmetry_from_input() const { return symmetry_from_input_; }
493 
498  void symmetrize(double tol=0.05, bool suppress_mol_print_in_exc=false);
500 
507  static std::shared_ptr<Molecule> create_molecule_from_string(const std::string &geom);
508 
515  std::string create_psi4_string_from_molecule() const;
516 
520  void activate_all_fragments();
521 
526 
531  void set_active_fragments(py::list reals);
532 
537  void set_active_fragment(int fragment);
538 
543  void set_ghost_fragments(py::list ghosts);
544 
549  void set_ghost_fragment(int fragment);
550 
558  std::shared_ptr<Molecule> extract_subsets(const std::vector<int> &real_list,
559  const std::vector<int> &ghost_list) const;
560 
567  std::shared_ptr<Molecule> py_extract_subsets_1(py::list reals,
568  py::list ghost);
569 
576  std::shared_ptr<Molecule> py_extract_subsets_2(py::list reals,
577  int ghost = -1);
578 
585  std::shared_ptr<Molecule> py_extract_subsets_3(int reals,
586  py::list ghost);
587 
594  std::shared_ptr<Molecule> py_extract_subsets_4(int reals,
595  int ghost = -1);
596 
602  std::shared_ptr<Molecule> py_extract_subsets_5(py::list reals);
603 
609  std::shared_ptr<Molecule> py_extract_subsets_6(int reals);
610 
611  // => Fragment Composition <= //
612 
614  const std::vector<std::pair<int, int> >& fragments() const { return fragments_; }
616  const std::vector<FragmentType>& fragment_types() const { return fragment_types_; }
618  const std::vector<int>& fragment_charges() const { return fragment_charges_; }
620  const std::vector<int>& fragment_multiplicities() const { return fragment_multiplicities_; }
621 
623  void set_has_zmatrix(bool tf) {zmat_ = tf;}
625  bool has_zmatrix() const {return zmat_;}
628  void set_variable(const std::string &str, double val);
631  double get_variable(const std::string &str);
634  bool is_variable(const std::string &str) const;
635 
639  int molecular_charge() const;
641  void set_multiplicity(int mult) { multiplicity_specified_ = true; multiplicity_ = mult; }
643  int multiplicity() const;
647  GeometryUnits units() const { return units_; }
648 
650  bool orientation_fixed() const { return fix_orientation_; }
652  void set_orientation_fixed(bool fix = true) { fix_orientation_ = fix;}
654  void set_com_fixed(bool fix = true) {move_to_com_ = !fix;}
656  std::string schoenflies_symbol() const;
658  bool valid_atom_map(double tol = 0.05) const;
660  std::string full_point_group() const;
662  std::string full_point_group_with_n() const { return FullPointGroupList[full_pg_];}
664  int full_pg_n() { return full_pg_n_; }
665 
670  void update_geometry();
671 };
672 
673 typedef std::shared_ptr<Molecule> SharedMolecule;
674 
675 }
676 
677 #endif
int multiplicity() const
Get the multiplicity (defined as 2Ms + 1)
Definition: libmints/molecule.cc:823
void activate_all_fragments()
Definition: libmints/molecule.cc:1503
Definition: libmints/molecule.h:51
int ** equiv_
Equivalent atom mapping array.
Definition: libmints/molecule.h:158
Molecule clone(void)
Definition: libmints/molecule.h:191
const std::shared_ptr< CoordEntry > & atom_entry(int atom) const
Returns the CoordEntry for an atom.
Definition: libmints/molecule.cc:3088
std::shared_ptr< PointGroup > point_group() const
Definition: libmints/molecule.cc:2748
bool reinterpret_coordentries_
Definition: libmints/molecule.h:174
Definition: libmints/molecule.h:50
Definition: libmints/molecule.h:50
const std::string & symmetry_from_input() const
Definition: libmints/molecule.h:492
Definition: libmints/molecule.h:51
Definition: libmints/molecule.h:51
void set_mass(int atom, double mass)
Set the mass of a particular atom (good for isotopic substitutions)
Definition: libmints/molecule.h:275
void set_variable(const std::string &str, double val)
Definition: libmints/molecule.cc:3119
Vector3 fxyz(int atom) const
Definition: libmints/molecule.cc:2968
Definition: libmints/molecule.h:76
std::string label(int atom) const
Returns the original label of the atom as given in the input file (C2, H4).
Definition: libmints/molecule.cc:326
bool is_variable(const std::string &str) const
Definition: libmints/molecule.cc:3143
Definition: libmints/molecule.h:49
Definition: libmints/molecule.h:87
std::string symmetry_from_input_
Symmetry string from geometry specification.
Definition: libmints/molecule.h:171
int molecular_charge() const
Gets the molecular charge.
Definition: libmints/molecule.cc:813
Definition: manybody.h:64
const std::vector< FragmentType > & fragment_types() const
A list describing how to handle each fragment.
Definition: libmints/molecule.h:616
Definition: libmints/molecule.h:88
int true_atomic_number(int atom) const
Returns the true atomic number of an atom.
Definition: libmints/molecule.cc:3028
Matrix * inertia_tensor() const
Compute inertia tensor.
Definition: libmints/molecule.cc:2006
bool fix_orientation_
Reorient or not?
Definition: libmints/molecule.h:108
Definition: libmints/molecule.h:70
double y(int atom) const
y position of atom
Definition: libmints/molecule.cc:2993
#define FULL_PG_TOL
Definition: libmints/molecule.h:41
int get_anchor_atom(const std::string &str, const std::string &line)
Definition: libmints/molecule.cc:3103
std::shared_ptr< Molecule > extract_subsets(const std::vector< int > &real_list, const std::vector< int > &ghost_list) const
Definition: libmints/molecule.cc:1620
void reinterpret_coordentries()
Definition: libmints/molecule.cc:1426
FragmentType
Definition: libmints/molecule.h:80
std::string schoenflies_symbol() const
Returns the Schoenflies symbol.
Definition: libmints/molecule.cc:3169
bool is_plane(Vector3 &origin, Vector3 &uperp, double tol=DEFAULT_SYM_TOL) const
Is a plane?
Definition: libmints/molecule.cc:2156
Vector3 nuclear_dipole() const
The dipole generated by the nuclear charges evaluated at the origin.
Definition: libmints/molecule.cc:352
void set_name(const std::string &_name)
Set molecule name.
Definition: libmints/molecule.h:245
void set_reinterpret_coordentry(bool rc)
Do we reinterpret coordentries during a call to update_geometry?
Definition: libmints/molecule.cc:251
double pairwise_nuclear_repulsion_energy(std::shared_ptr< Molecule > other) const
Computes the nuclear repuslion energy between this and another Molecule.
Definition: libmints/molecule.cc:400
void move_to_com()
Moves molecule to center of mass.
Definition: libmints/molecule.cc:521
std::vector< std::shared_ptr< CoordEntry > > EntryVector
Definition: libmints/molecule.h:92
std::shared_ptr< Molecule > py_extract_subsets_1(py::list reals, py::list ghost)
Definition: libmints/molecule.cc:1558
void rotate_full(const Matrix &R)
Definition: libmints/molecule.cc:671
void init_with_xyz(const std::string &xyzfilename)
Definition: libmints/molecule.cc:713
Definition: libmints/molecule.h:51
Definition: libmints/molecule.h:50
std::shared_ptr< Molecule > py_extract_subsets_5(py::list reals)
Definition: libmints/molecule.cc:1610
void print_in_input_format() const
Print the molecule in the same format that the user provided.
Definition: libmints/molecule.cc:1689
EntryVector::iterator EntryVectorIter
Definition: libmints/molecule.h:93
FragmentLevel
Definition: libmints/molecule.h:86
std::shared_ptr< Molecule > py_extract_subsets_6(int reals)
Definition: libmints/molecule.cc:1615
void print() const
Print the molecule.
Definition: libmints/molecule.cc:1719
void print_in_bohr() const
Print the molecule in Bohr.
Definition: libmints/molecule.cc:1663
void set_active_fragment(int fragment)
Definition: libmints/molecule.cc:1537
Definition: libmints/molecule.h:49
int molecular_charge_
The molecular charge.
Definition: libmints/molecule.h:117
void set_ghost_fragments(py::list ghosts)
Definition: libmints/molecule.cc:1543
Molecule operator-(const Molecule &other)
Subtraction.
int nunique_
Number of unique atoms.
Definition: libmints/molecule.h:154
Definition: vector3.h:36
RotorType
Definition: libmints/molecule.h:49
void reset_point_group(const std::string &pgname)
Override symmetry from outside the molecule string.
Definition: libmints/molecule.cc:2667
const std::vector< int > & fragment_multiplicities() const
The multiplicity of each fragment.
Definition: libmints/molecule.h:620
const std::string RotorTypeList[]
Definition: libmints/molecule.h:53
double fmass(int atom) const
Returns mass atom atom.
Definition: libmints/molecule.cc:3093
GeometryUnits units_
The units used to define the geometry.
Definition: libmints/molecule.h:121
std::vector< FragmentType > fragment_types_
A list describing how to handle each fragment.
Definition: libmints/molecule.h:165
Definition: libmints/molecule.h:50
void print_distances() const
Print the geometrical parameters of the molecule.
Definition: libmints/molecule.cc:1817
void is_linear_planar(bool &linear, bool &planar, double tol=DEFAULT_SYM_TOL) const
Is the molecule linear, or planar?
Definition: libmints/molecule.cc:2212
void set_basis_by_symbol(const std::string &symbol, const std::string &name, const std::string &type="BASIS")
Definition: libmints/molecule.cc:3063
std::vector< std::pair< int, int > > fragments_
The list of atom ranges defining each fragment from parent molecule.
Definition: libmints/molecule.h:183
std::shared_ptr< Matrix > symmetry_frame(double tol=DEFAULT_SYM_TOL)
Definition: libmints/molecule.cc:2283
void print_dihedrals() const
Definition: libmints/molecule.cc:1853
void update_geometry()
Definition: libmints/molecule.cc:1466
std::map< std::string, double > geometry_variables_
A listing of the variables used to define the geometries.
Definition: libmints/molecule.h:163
Definition: libmints/molecule.h:50
void form_symmetry_information(double tol=DEFAULT_SYM_TOL)
Definition: libmints/molecule.cc:2828
int nequivalent(int iuniq) const
Returns the number of atoms equivalent to iuniq.
Definition: libmints/molecule.h:445
int equivalent(int iuniq, int j) const
Returns the j&#39;th atom equivalent to iuniq.
Definition: libmints/molecule.h:447
void release_symmetry_information()
Release symmetry information.
Definition: libmints/molecule.cc:2814
std::shared_ptr< PointGroup > pg_
Point group to use with this molecule.
Definition: libmints/molecule.h:147
int full_pg_n()
Return n in Cnv, etc.; If there is no n (e.g. Td) it&#39;s the highest-order rotation axis...
Definition: libmints/molecule.h:664
int atom_at_position2(Vector3 &, double tol=0.05) const
Definition: libmints/molecule.cc:342
Matrix full_geometry() const
Returns the full (dummies included) in a Matrix.
Definition: libmints/molecule.cc:539
Matrix nuclear_repulsion_energy_deriv2() const
Computes nuclear repulsion energy second derivatives.
Definition: libmints/molecule.cc:452
const std::vector< std::pair< int, int > > & fragments() const
The list of atom ranges defining each fragment from parent molecule (fragments[frag_ind] = &lt;Afirst...
Definition: libmints/molecule.h:614
std::vector< int > fragment_multiplicities_
The multiplicity of each fragment.
Definition: libmints/molecule.h:105
Definition: libmints/molecule.h:50
Matrix geometry() const
Returns the geometry in a Matrix.
Definition: libmints/molecule.cc:527
bool charge_specified_
Whether the charge was given by the user.
Definition: libmints/molecule.h:113
const double & Z(int atom) const
Nuclear charge of atom.
Definition: libmints/molecule.cc:2978
GeometryFormat
Definition: libmints/molecule.h:69
bool charge_specified() const
Whether the charge was given by the user.
Definition: libmints/molecule.h:233
const std::string name() const
Get molecule name.
Definition: libmints/molecule.h:243
bool has_inversion(Vector3 &origin, double tol=DEFAULT_SYM_TOL) const
Does the molecule have an inversion center at origin.
Definition: libmints/molecule.cc:2144
void print_rotational_constants(void) const
Print the rotational constants.
Definition: libmints/molecule.cc:2076
int multiplicity_
The multiplicity (defined as 2Ms + 1)
Definition: libmints/molecule.h:119
const std::string FullPointGroupList[]
Definition: libmints/molecule.h:56
std::string flabel(int atom) const
Returns label of atom.
Definition: libmints/molecule.cc:3098
std::string symbol(int atom) const
Returns the cleaned up label of the atom (C2 =&gt; C, H4 = H)
Definition: libmints/molecule.cc:316
void rotate(const Matrix &R)
Definition: libmints/molecule.cc:660
std::shared_ptr< Molecule > py_extract_subsets_3(int reals, py::list ghost)
Definition: libmints/molecule.cc:1586
void print_out_of_planes() const
Definition: libmints/molecule.cc:1896
const std::vector< int > & fragment_charges() const
The charge of each fragment.
Definition: libmints/molecule.h:618
std::string full_point_group_with_n() const
Return point group name such as Cnv or Sn.
Definition: libmints/molecule.h:662
bool lock_frame_
Nilpotence boolean (flagged upon first determination of symmetry frame, reset each time a substantiat...
Definition: libmints/molecule.h:176
Definition: libmints/molecule.h:51
int nfragments() const
The number of fragments in the molecule.
Definition: libmints/molecule.h:235
void print_in_angstrom() const
Print the molecule in Angstrom.
Definition: libmints/molecule.cc:1637
int nactive_fragments()
The number of active fragments in the molecule.
Definition: libmints/molecule.cc:1511
std::string save_string_xyz_file() const
Save an XYZ file to a string.
Definition: libmints/molecule.cc:1959
int nfrozen_core(const std::string &depth="")
Number of frozen core for molecule given freezing state.
Definition: libmints/molecule.cc:682
bool valid_atom_map(double tol=0.05) const
Check if current geometry fits current point group.
Definition: libmints/molecule.cc:3175
Molecule & operator=(const Molecule &other)
Definition: libmints/molecule.cc:190
Molecule()
Definition: libmints/molecule.cc:160
std::string fsymbol(int atom) const
Returns the cleaned up label of the atom (C2 =&gt; C, H4 = H)
Definition: libmints/molecule.cc:321
bool has_zmatrix() const
Whether this molecule has at least one zmatrix entry.
Definition: libmints/molecule.h:625
Vector rotational_constants(double tol=FULL_PG_TOL) const
Compute the rotational constants and return them in wavenumbers.
Definition: libmints/molecule.cc:2040
std::string save_string_xyz() const
Save an XYZ string.
Definition: libmints/molecule.cc:1987
bool is_axis(Vector3 &origin, Vector3 &axis, int order, double tol=DEFAULT_SYM_TOL) const
Is an axis?
Definition: libmints/molecule.cc:2171
int full_pg_n_
n of the highest rotational axis Cn
Definition: libmints/molecule.h:151
char ** irrep_labels()
Returns the irrep labels.
Definition: libmints/molecule.cc:2949
Definition: libmints/molecule.h:51
void symmetrize(double tol=0.05, bool suppress_mol_print_in_exc=false)
Definition: libmints/molecule.cc:2778
EntryVector full_atoms_
Atom info vector (includes dummy atoms)
Definition: libmints/molecule.h:101
void reinterpret_fragments()
void operator+=(const Molecule &other)
Plus equals.
Definition: libmints/molecule.cc:269
Definition: libmints/molecule.h:49
void print_bond_angles() const
Definition: libmints/molecule.cc:1830
std::shared_ptr< Molecule > py_extract_subsets_2(py::list reals, int ghost=-1)
Definition: libmints/molecule.cc:1572
void deactivate_all_fragments()
Definition: libmints/molecule.cc:1520
int atom_at_position1(double *, double tol=0.05) const
Definition: libmints/molecule.cc:331
int nunique() const
Definition: libmints/molecule.h:441
int max_nequivalent() const
Definition: libmints/molecule.cc:2274
Definition: libmints/molecule.h:76
Makes using matrices just a little easier.
Definition: libmints/matrix.h:71
void print_full() const
Print full atom list.
Definition: libmints/molecule.cc:1792
void set_geometry(double **geom)
Definition: libmints/molecule.cc:551
void set_ghost_fragment(int fragment)
Definition: libmints/molecule.cc:1552
CoordValue * get_coord_value(const std::string &str)
Definition: libmints/molecule.cc:3148
FullPointGroup full_pg_
Full point group.
Definition: libmints/molecule.h:149
std::string sym_label()
Returns the symmetry label.
Definition: libmints/molecule.cc:2943
double charge(int atom) const
Returns charge of atom.
Definition: libmints/molecule.cc:3018
double fZ(int atom) const
Nuclear charge of atom.
Definition: libmints/molecule.cc:2983
int atom_to_unique(int iatom) const
Definition: libmints/molecule.h:450
void set_units(GeometryUnits units)
Sets the geometry units.
Definition: libmints/molecule.h:645
bool orientation_fixed() const
Get whether or not orientation is fixed.
Definition: libmints/molecule.h:650
Definition: coordentry.h:56
Definition: libmints/molecule.h:49
bool multiplicity_specified() const
Whether the multiplicity was given by the user.
Definition: libmints/molecule.h:231
static std::shared_ptr< Molecule > create_molecule_from_string(const std::string &geom)
Definition: libmints/molecule.cc:828
void set_shell_by_label(const std::string &label, const std::string &name, const std::string &type="BASIS")
Definition: libmints/molecule.cc:3079
int * nequiv_
Number of equivalent atoms per unique atom (length nunique_)
Definition: libmints/molecule.h:156
std::shared_ptr< PointGroup > find_highest_point_group(double tol=DEFAULT_SYM_TOL) const
Find highest molecular point group.
Definition: libmints/molecule.cc:2602
#define DEFAULT_SYM_TOL
Definition: libmints/molecule.h:40
void set_full_point_group(double tol=FULL_PG_TOL)
Determine and set FULL point group.
Definition: libmints/molecule.cc:3224
virtual ~Molecule()
Definition: libmints/molecule.cc:182
double nuclear_repulsion_energy() const
Computes nuclear repulsion energy.
Definition: libmints/molecule.cc:412
void add_atom(int Z, double x, double y, double z, const char *symb="", double mass=0.0, double charge=0.0, int lineno=-1)
Definition: libmints/molecule.cc:281
void set_basis_by_label(const std::string &label, const std::string &name, const std::string &type="BASIS")
Definition: libmints/molecule.cc:3071
int atom_to_unique_offset(int iatom) const
Definition: libmints/molecule.cc:2262
Definition: libmints/molecule.h:49
void set_com_fixed(bool fix=true)
Fix the center of mass at its current frame.
Definition: libmints/molecule.h:654
Definition: libmints/molecule.h:81
Matrix distance_matrix() const
Computes and returns a matrix depicting distances between atoms.
Definition: libmints/molecule.cc:387
double z(int atom) const
z position of atom
Definition: libmints/molecule.cc:2998
std::string full_point_group() const
Return point group name such as C3v or S8.
Definition: libmints/molecule.cc:3526
FullPointGroup
Definition: libmints/molecule.h:50
std::shared_ptr< PointGroup > find_point_group(double tol=DEFAULT_SYM_TOL) const
Find computational molecular point group, user can override this with the &quot;symmetry&quot; keyword...
Definition: libmints/molecule.cc:2674
void set_orientation_fixed(bool fix=true)
Fix the orientation at its current frame.
Definition: libmints/molecule.h:652
bool zmat_
Whether this molecule has at least one zmatrix entry.
Definition: libmints/molecule.h:178
RotorType rotor_type(double tol=FULL_PG_TOL) const
Return the rotor type.
Definition: libmints/molecule.cc:2102
std::vector< int > fragment_charges_
The charge of each fragment.
Definition: libmints/molecule.h:103
double x(int atom) const
x position of atom
Definition: libmints/molecule.cc:2988
std::pair< int, int > fragment_atom_pair(int f)
Returns the list of atoms belonging to a fragment.
Definition: libmints/molecule.h:240
bool multiplicity_specified_
Whether the multiplicity was specified by the user.
Definition: libmints/molecule.h:115
std::string name_
Molecule (or fragment) name.
Definition: libmints/molecule.h:97
void set_molecular_charge(int charge)
Sets the molecular charge.
Definition: libmints/molecule.h:637
EntryVector atoms_
Atom info vector (no knowledge of dummy atoms)
Definition: libmints/molecule.h:99
std::shared_ptr< Molecule > SharedMolecule
Definition: libmints/molecule.h:673
Definition: libmints/molecule.h:50
int unique(int iuniq) const
Returns the overall number of the iuniq&#39;th unique atom.
Definition: libmints/molecule.h:443
void set_basis_all_atoms(const std::string &name, const std::string &type="BASIS")
Definition: libmints/molecule.cc:3042
void clear()
Zero it out.
Definition: libmints/molecule.cc:274
void set_basis_by_number(int number, const std::string &name, const std::string &type="BASIS")
Definition: libmints/molecule.cc:3053
Molecule information class.
Definition: libmints/molecule.h:63
void set_active_fragments(py::list reals)
Definition: libmints/molecule.cc:1528
double input_units_to_au_
The conversion factor to take input units to Bohr.
Definition: libmints/molecule.h:123
double fy(int atom) const
y position of atom
Definition: libmints/molecule.cc:3008
Definition: libmints/molecule.h:51
double mass(int atom) const
Returns mass atom atom.
Definition: libmints/molecule.cc:300
Definition: libmints/molecule.h:89
Definition: libmints/molecule.h:82
bool has_symmetry_element(Vector3 &op, double tol=DEFAULT_SYM_TOL) const
Definition: libmints/molecule.cc:2762
Molecule operator+(const Molecule &other)
Addition.
void set_multiplicity(int mult)
Sets the multiplicity (defined as 2Ms + 1)
Definition: libmints/molecule.h:641
Vector3 xyz(int atom) const
Returns a Vector3 with x, y, z position of atom.
Definition: libmints/molecule.cc:2963
GeometryUnits units() const
Gets the geometry units.
Definition: libmints/molecule.h:647
void print_cluster() const
Print the molecule, adding spacers.
Definition: libmints/molecule.cc:1756
Definition: libmints/molecule.h:51
Definition: libmints/molecule.h:83
int nallatom() const
Number of all atoms (includes dummies)
Definition: libmints/molecule.h:249
void set_point_group(std::shared_ptr< PointGroup > pg)
Definition: libmints/molecule.cc:2755
std::vector< std::string > all_variables_
A list of all variables known, whether they have been set or not.
Definition: libmints/molecule.h:125
double fcharge(int atom) const
Returns charge of atom.
Definition: libmints/molecule.cc:3023
Definition: vector.h:48
void save_xyz_file(const std::string &filename, bool save_ghosts=true) const
Save an XYZ file.
Definition: libmints/molecule.cc:1936
std::string create_psi4_string_from_molecule() const
Definition: libmints/molecule.cc:1341
double fz(int atom) const
z position of atom
Definition: libmints/molecule.cc:3013
void set_has_zmatrix(bool tf)
Sets whether this molecule contains at least one zmatrix entry.
Definition: libmints/molecule.h:623
double get_variable(const std::string &str)
Definition: libmints/molecule.cc:3134
double fx(int atom) const
x position of atom
Definition: libmints/molecule.cc:3003
int ftrue_atomic_number(int atom) const
Definition: libmints/molecule.cc:3035
GeometryUnits
Definition: libmints/molecule.h:76
void translate(const Vector3 &r)
Translates molecule by r.
Definition: libmints/molecule.cc:510
int * atom_to_unique_
Atom to unique atom mapping array (length natom)
Definition: libmints/molecule.h:160
int natom() const
Number of atoms.
Definition: libmints/molecule.cc:3550
void set_full_geometry(double **geom)
Definition: libmints/molecule.cc:638
std::shared_ptr< Molecule > py_extract_subsets_4(int reals, int ghost=-1)
Definition: libmints/molecule.cc:1598
void symmetrize_to_abelian_group(double tol)
Definition: libmints/molecule.cc:1411
Definition: libmints/molecule.h:71
Vector3 center_of_mass() const
Computes center of mass of molecule (does not translate molecule)
Definition: libmints/molecule.cc:368
Definition: libmints/molecule.h:50
Matrix nuclear_repulsion_energy_deriv1() const
Computes nuclear repulsion energy derivatives.
Definition: libmints/molecule.cc:429
bool move_to_com_
Move to center of mass or not?
Definition: libmints/molecule.h:110