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 file is part of Psi4.
12  *
13  * Psi4 is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation, version 3.
16  *
17  * Psi4 is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License along
23  * with Psi4; if not, write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  *
26  * @END LICENSE
27  */
28 
29 #ifndef _psi_src_lib_libmints_molecule_h_
30 #define _psi_src_lib_libmints_molecule_h_
31 
32 #include <vector>
33 #include <string>
34 #include <cstdio>
35 #include <map>
36 #include <memory>
37 
38 #include "psi4/pybind11.h"
39 
40 #define LINEAR_A_TOL 1.0E-2 //When sin(a) is below this, we consider the angle to be linear
41 #define DEFAULT_SYM_TOL 1.0E-8
42 #define FULL_PG_TOL 1.0e-8 // default
43 
44 #include "typedefs.h"
45 #include "coordentry.h"
46 
47 namespace psi {
48 class PointGroup;
49 class BasisSet;
53 
54 const std::string RotorTypeList[] = {"ASYMMETRIC_TOP", "SYMMETRIC_TOP",
55  "SPHERICAL_TOP", "LINEAR", "ATOM"};
56 
57 const std::string FullPointGroupList[] = {"ATOM", "C_inf_v", "D_inf_h", "C1", "Cs", "Ci", "Cn", "Cnv",
58  "Cnh", "Sn", "Dn", "Dnd", "Dnh", "Td", "Oh", "Ih"};
59 
64 class Molecule
65 {
66 public:
73  };
81  enum FragmentType {
83  Real,
85  };
86 
88  QMatom = 1,
89  EFPatom = 2,
90  ALLatom = 3
91  };
92 
93  typedef std::vector<std::shared_ptr<CoordEntry> > EntryVector;
94  typedef EntryVector::iterator EntryVectorIter;
95 
96 protected:
98  std::string name_;
104  std::vector<int> fragment_charges_;
106  std::vector<int> fragment_multiplicities_;
107 
112 
126  std::vector<std::string> all_variables_;
128  void clear();
129 
136  CoordValue* get_coord_value(const std::string &str);
137 
145  int get_anchor_atom(const std::string &str, const std::string &line);
146 
148  std::shared_ptr<PointGroup> pg_;
153 
155  int nunique_;
157  int *nequiv_;
159  int **equiv_;
162 
164  std::map<std::string, double> geometry_variables_;
166  std::vector<FragmentType> fragment_types_;
167 //****AVC****//
168 // moved fragments_ to public
169 // moved fragment_levels_ to public
170 //****AVC****//
172  std::string symmetry_from_input_;
179  bool zmat_;
180 
181 public:
182 //****AVC****//
184  std::vector<std::pair<int, int> > fragments_;
185 //****AVC****//
186 
187  Molecule();
189  Molecule(const Molecule& other);
190  virtual ~Molecule();
191 
192  Molecule clone(void) {
193  Molecule new_obj(*this);
194  return new_obj;
195  }
196 
200  Molecule& operator=(const Molecule& other);
202  Molecule operator+(const Molecule& other);
204  Molecule operator-(const Molecule& other);
206  void operator+=(const Molecule& other);
208 
209 
214  void init_with_xyz(const std::string& xyzfilename);
215 
227  void add_atom(int Z, double x, double y, double z,
228  const char *symb = "", double mass = 0.0,
229  double charge = 0.0, int lineno = -1);
230 
234  bool charge_specified() const { return charge_specified_; }
236  int nfragments() const { return fragments_.size();}
238  int nactive_fragments();
240  // Needed for EFP interface
241  std::pair<int, int> fragment_atom_pair(int f) { return fragments_[f]; }
242 
244  const std::string name() const {return name_; }
246  const std::string& basis_on_atom(int atom) const;
248  void set_name(const std::string &_name) { name_ = _name; }
250  int natom() const;
252  int nallatom() const { return full_atoms_.size(); }
254  const double& Z(int atom) const;
256  double fZ(int atom) const;
258  double x(int atom) const;
260  double y(int atom) const;
262  double z(int atom) const;
264  double fx(int atom) const;
266  double fy(int atom) const;
268  double fz(int atom) const;
270  Vector3 xyz(int atom) const;
271  Vector3 fxyz(int atom) const;
273  double xyz(int atom, int _xyz) const;
275  double mass(int atom) const;
276 
278  void set_mass(int atom, double mass) { full_atoms_[atom]->set_mass(mass); }
280  void set_nuclear_charge(int atom, double newZ);
281 
283  std::string symbol(int atom) const;
285  std::string fsymbol(int atom) const;
287  std::string label(int atom) const;
289  double charge(int atom) const;
291  int true_atomic_number(int atom) const;
292  int ftrue_atomic_number(int atom) const;
294  double fmass(int atom) const;
296  std::string flabel(int atom) const;
298  double fcharge(int atom) const;
300  const std::shared_ptr<CoordEntry>& atom_entry(int atom) const;
301 
302  void set_basis_all_atoms(const std::string& name, const std::string& type="BASIS");
303  void set_basis_by_symbol(const std::string& symbol, const std::string& name, const std::string& type="BASIS");
304  void set_basis_by_number(int number, const std::string& name, const std::string& type="BASIS");
305  void set_basis_by_label(const std::string& label, const std::string& name, const std::string& type="BASIS");
306  void set_shell_by_label(const std::string& label, const std::string& name, const std::string& type="BASIS");
307 
310  int atom_at_position1(double *, double tol = 0.05) const;
311  int atom_at_position2(Vector3&, double tol = 0.05) const;
313 
315  void set_reinterpret_coordentry(bool rc);
316 
318  Matrix geometry() const;
320  Matrix full_geometry() const;
321 
326  void set_geometry(double** geom);
327 
331  void set_geometry(const Matrix& geom);
332 
336  void set_full_geometry(double** geom);
337 
341  void set_full_geometry(const Matrix& geom);
342 
346  void rotate(const Matrix& R);
347  void rotate_full(const Matrix& R);
348 
353 
357  void reinterpret_fragments();
358 
363  void symmetrize_to_abelian_group(double tol);
364 
366  Vector3 center_of_mass() const;
368  double nuclear_repulsion_energy() const;
370  Vector3 nuclear_dipole() const;
372  Vector3 nuclear_dipole(const Vector3 &origin) const;
377 
379  double pairwise_nuclear_repulsion_energy(std::shared_ptr<Molecule> other) const;
380 
382  void translate(const Vector3& r);
384  void move_to_com();
390 // void reorient();
391 
393  Matrix distance_matrix() const;
394 
396  Matrix* inertia_tensor() const;
397 
399  Vector rotational_constants(double tol = FULL_PG_TOL) const;
400 
402  void print_rotational_constants(void) const;
404  RotorType rotor_type(double tol = FULL_PG_TOL) const;
405 
407  void print() const;
408 
410  void print_cluster() const;
411 
413  void print_full() const;
414 
416  void print_in_input_format() const;
417 
419  void print_in_bohr() const;
420 
422  void print_in_angstrom() const;
423 
425  void print_distances() const;
426  void print_bond_angles() const;
427  void print_dihedrals() const;
428  void print_out_of_planes() const;
429 
431  void save_xyz_file(const std::string & filename, bool save_ghosts = true) const;
433  std::string save_string_xyz_file() const;
434 
436  std::string save_string_xyz() const;
437 
443  int nunique() const { return nunique_; }
445  int unique(int iuniq) const { return equiv_[iuniq][0]; }
447  int nequivalent(int iuniq) const { return nequiv_[iuniq]; }
449  int equivalent(int iuniq, int j) const { return equiv_[iuniq][j]; }
452  int atom_to_unique(int iatom) const { return atom_to_unique_[iatom]; }
455  int atom_to_unique_offset(int iatom) const;
457  int max_nequivalent() const;
459 
463  bool has_symmetry_element(Vector3& op, double tol=DEFAULT_SYM_TOL) const;
464  std::shared_ptr<PointGroup> point_group() const;
465  void set_point_group(std::shared_ptr<PointGroup> pg);
467  void set_full_point_group(double tol=FULL_PG_TOL);
469  bool has_inversion(Vector3& origin, double tol=DEFAULT_SYM_TOL) const;
471  bool is_plane(Vector3& origin, Vector3& uperp, double tol=DEFAULT_SYM_TOL) const;
473  bool is_axis(Vector3& origin, Vector3& axis, int order, double tol=DEFAULT_SYM_TOL) const;
475  void is_linear_planar(bool& linear, bool& planar, double tol=DEFAULT_SYM_TOL) const;
477  std::shared_ptr<PointGroup> find_point_group(double tol=DEFAULT_SYM_TOL) const;
479  void reset_point_group(const std::string& pgname);
481  std::shared_ptr<PointGroup> find_highest_point_group(double tol=DEFAULT_SYM_TOL) const;
484  std::shared_ptr<Matrix> symmetry_frame(double tol=DEFAULT_SYM_TOL);
491  std::string sym_label();
493  char **irrep_labels();
494  const std::string& symmetry_from_input() const { return symmetry_from_input_; }
495 
500  void symmetrize(double tol=0.05, bool suppress_mol_print_in_exc=false);
502 
509  static std::shared_ptr<Molecule> create_molecule_from_string(const std::string &geom);
510 
517  std::string create_psi4_string_from_molecule() const;
518 
522  void activate_all_fragments();
523 
528 
533  void set_active_fragments(py::list reals);
534 
539  void set_active_fragment(int fragment);
540 
545  void set_ghost_fragments(py::list ghosts);
546 
551  void set_ghost_fragment(int fragment);
552 
560  std::shared_ptr<Molecule> extract_subsets(const std::vector<int> &real_list,
561  const std::vector<int> &ghost_list) const;
562 
569  std::shared_ptr<Molecule> py_extract_subsets_1(py::list reals,
570  py::list ghost);
571 
578  std::shared_ptr<Molecule> py_extract_subsets_2(py::list reals,
579  int ghost = -1);
580 
587  std::shared_ptr<Molecule> py_extract_subsets_3(int reals,
588  py::list ghost);
589 
596  std::shared_ptr<Molecule> py_extract_subsets_4(int reals,
597  int ghost = -1);
598 
604  std::shared_ptr<Molecule> py_extract_subsets_5(py::list reals);
605 
611  std::shared_ptr<Molecule> py_extract_subsets_6(int reals);
612 
613  // => Fragment Composition <= //
614 
616  const std::vector<std::pair<int, int> >& fragments() const { return fragments_; }
618  const std::vector<FragmentType>& fragment_types() const { return fragment_types_; }
620  const std::vector<int>& fragment_charges() const { return fragment_charges_; }
622  const std::vector<int>& fragment_multiplicities() const { return fragment_multiplicities_; }
623 
625  void set_has_zmatrix(bool tf) {zmat_ = tf;}
627  bool has_zmatrix() const {return zmat_;}
630  void set_variable(const std::string &str, double val);
633  double get_variable(const std::string &str);
636  bool is_variable(const std::string &str) const;
637 
641  int molecular_charge() const;
643  void set_multiplicity(int mult) { multiplicity_specified_ = true; multiplicity_ = mult; }
645  int multiplicity() const;
649  GeometryUnits units() const { return units_; }
650 
652  bool orientation_fixed() const { return fix_orientation_; }
654  void set_orientation_fixed(bool fix = true) { fix_orientation_ = fix;}
656  void set_com_fixed(bool fix = true) {move_to_com_ = !fix;}
658  std::string schoenflies_symbol() const;
660  bool valid_atom_map(double tol = 0.05) const;
662  std::string full_point_group() const;
664  std::string full_point_group_with_n() const { return FullPointGroupList[full_pg_];}
666  int full_pg_n() { return full_pg_n_; }
667 
672  void update_geometry();
673 };
674 
675 }
676 
677 #endif
int multiplicity() const
Get the multiplicity (defined as 2Ms + 1)
Definition: libmints/molecule.cc:794
void activate_all_fragments()
Definition: libmints/molecule.cc:1474
Definition: libmints/molecule.h:52
int ** equiv_
Equivalent atom mapping array.
Definition: libmints/molecule.h:159
Molecule clone(void)
Definition: libmints/molecule.h:192
const std::shared_ptr< CoordEntry > & atom_entry(int atom) const
Returns the CoordEntry for an atom.
Definition: libmints/molecule.cc:3069
std::shared_ptr< PointGroup > point_group() const
Definition: libmints/molecule.cc:2719
bool reinterpret_coordentries_
Definition: libmints/molecule.h:175
Definition: libmints/molecule.h:51
Definition: libmints/molecule.h:51
const std::string & symmetry_from_input() const
Definition: libmints/molecule.h:494
Definition: libmints/molecule.h:52
Definition: libmints/molecule.h:52
void set_mass(int atom, double mass)
Set the mass of a particular atom (good for isotopic substitutions)
Definition: libmints/molecule.h:278
void set_variable(const std::string &str, double val)
Definition: libmints/molecule.cc:3100
Vector3 fxyz(int atom) const
Definition: libmints/molecule.cc:2939
Definition: libmints/molecule.h:77
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:328
bool is_variable(const std::string &str) const
Definition: libmints/molecule.cc:3124
Definition: libmints/molecule.h:50
Definition: libmints/molecule.h:88
std::string symmetry_from_input_
Symmetry string from geometry specification.
Definition: libmints/molecule.h:172
int molecular_charge() const
Gets the molecular charge.
Definition: libmints/molecule.cc:784
Definition: manybody.h:65
const std::vector< FragmentType > & fragment_types() const
A list describing how to handle each fragment.
Definition: libmints/molecule.h:618
Definition: libmints/molecule.h:89
int true_atomic_number(int atom) const
Returns the true atomic number of an atom.
Definition: libmints/molecule.cc:3009
Matrix * inertia_tensor() const
Compute inertia tensor.
Definition: libmints/molecule.cc:1977
bool fix_orientation_
Reorient or not?
Definition: libmints/molecule.h:109
Definition: libmints/molecule.h:71
double y(int atom) const
y position of atom
Definition: libmints/molecule.cc:2964
#define FULL_PG_TOL
Definition: libmints/molecule.h:42
const std::string & basis_on_atom(int atom) const
Returns the name of the basis set on the specified atom.
Definition: libmints/molecule.cc:3004
int get_anchor_atom(const std::string &str, const std::string &line)
Definition: libmints/molecule.cc:3084
std::shared_ptr< Molecule > extract_subsets(const std::vector< int > &real_list, const std::vector< int > &ghost_list) const
Definition: libmints/molecule.cc:1591
void reinterpret_coordentries()
Definition: libmints/molecule.cc:1397
FragmentType
Definition: libmints/molecule.h:81
std::string schoenflies_symbol() const
Returns the Schoenflies symbol.
Definition: libmints/molecule.cc:3150
bool is_plane(Vector3 &origin, Vector3 &uperp, double tol=DEFAULT_SYM_TOL) const
Is a plane?
Definition: libmints/molecule.cc:2127
Vector3 nuclear_dipole() const
The dipole generated by the nuclear charges evaluated at the origin.
Definition: libmints/molecule.cc:354
void set_name(const std::string &_name)
Set molecule name.
Definition: libmints/molecule.h:248
void set_reinterpret_coordentry(bool rc)
Do we reinterpret coordentries during a call to update_geometry?
Definition: libmints/molecule.cc:253
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:402
void move_to_com()
Moves molecule to center of mass.
Definition: libmints/molecule.cc:523
std::vector< std::shared_ptr< CoordEntry > > EntryVector
Definition: libmints/molecule.h:93
std::shared_ptr< Molecule > py_extract_subsets_1(py::list reals, py::list ghost)
Definition: libmints/molecule.cc:1529
void rotate_full(const Matrix &R)
Definition: libmints/molecule.cc:673
void init_with_xyz(const std::string &xyzfilename)
Definition: libmints/molecule.cc:684
Definition: libmints/molecule.h:52
Definition: libmints/molecule.h:51
std::shared_ptr< Molecule > py_extract_subsets_5(py::list reals)
Definition: libmints/molecule.cc:1581
void print_in_input_format() const
Print the molecule in the same format that the user provided.
Definition: libmints/molecule.cc:1660
EntryVector::iterator EntryVectorIter
Definition: libmints/molecule.h:94
FragmentLevel
Definition: libmints/molecule.h:87
std::shared_ptr< Molecule > py_extract_subsets_6(int reals)
Definition: libmints/molecule.cc:1586
void print() const
Print the molecule.
Definition: libmints/molecule.cc:1690
void print_in_bohr() const
Print the molecule in Bohr.
Definition: libmints/molecule.cc:1634
void set_active_fragment(int fragment)
Definition: libmints/molecule.cc:1508
Definition: libmints/molecule.h:50
int molecular_charge_
The molecular charge.
Definition: libmints/molecule.h:118
void set_ghost_fragments(py::list ghosts)
Definition: libmints/molecule.cc:1514
Molecule operator-(const Molecule &other)
Subtraction.
int nunique_
Number of unique atoms.
Definition: libmints/molecule.h:155
Definition: vector3.h:37
RotorType
Definition: libmints/molecule.h:50
void reset_point_group(const std::string &pgname)
Override symmetry from outside the molecule string.
Definition: libmints/molecule.cc:2638
const std::vector< int > & fragment_multiplicities() const
The multiplicity of each fragment.
Definition: libmints/molecule.h:622
const std::string RotorTypeList[]
Definition: libmints/molecule.h:54
double fmass(int atom) const
Returns mass atom atom.
Definition: libmints/molecule.cc:3074
GeometryUnits units_
The units used to define the geometry.
Definition: libmints/molecule.h:122
std::vector< FragmentType > fragment_types_
A list describing how to handle each fragment.
Definition: libmints/molecule.h:166
Definition: libmints/molecule.h:51
void print_distances() const
Print the geometrical parameters of the molecule.
Definition: libmints/molecule.cc:1788
void is_linear_planar(bool &linear, bool &planar, double tol=DEFAULT_SYM_TOL) const
Is the molecule linear, or planar?
Definition: libmints/molecule.cc:2183
void set_basis_by_symbol(const std::string &symbol, const std::string &name, const std::string &type="BASIS")
Definition: libmints/molecule.cc:3044
std::vector< std::pair< int, int > > fragments_
The list of atom ranges defining each fragment from parent molecule.
Definition: libmints/molecule.h:184
std::shared_ptr< Matrix > symmetry_frame(double tol=DEFAULT_SYM_TOL)
Definition: libmints/molecule.cc:2254
void print_dihedrals() const
Definition: libmints/molecule.cc:1824
void update_geometry()
Definition: libmints/molecule.cc:1437
std::map< std::string, double > geometry_variables_
A listing of the variables used to define the geometries.
Definition: libmints/molecule.h:164
Definition: libmints/molecule.h:51
void form_symmetry_information(double tol=DEFAULT_SYM_TOL)
Definition: libmints/molecule.cc:2799
int nequivalent(int iuniq) const
Returns the number of atoms equivalent to iuniq.
Definition: libmints/molecule.h:447
int equivalent(int iuniq, int j) const
Returns the j&#39;th atom equivalent to iuniq.
Definition: libmints/molecule.h:449
void release_symmetry_information()
Release symmetry information.
Definition: libmints/molecule.cc:2785
std::shared_ptr< PointGroup > pg_
Point group to use with this molecule.
Definition: libmints/molecule.h:148
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:666
int atom_at_position2(Vector3 &, double tol=0.05) const
Definition: libmints/molecule.cc:344
Matrix full_geometry() const
Returns the full (dummies included) in a Matrix.
Definition: libmints/molecule.cc:541
Matrix nuclear_repulsion_energy_deriv2() const
Computes nuclear repulsion energy second derivatives.
Definition: libmints/molecule.cc:454
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:616
std::vector< int > fragment_multiplicities_
The multiplicity of each fragment.
Definition: libmints/molecule.h:106
Definition: libmints/molecule.h:51
Matrix geometry() const
Returns the geometry in a Matrix.
Definition: libmints/molecule.cc:529
bool charge_specified_
Whether the charge was given by the user.
Definition: libmints/molecule.h:114
const double & Z(int atom) const
Nuclear charge of atom.
Definition: libmints/molecule.cc:2949
GeometryFormat
Definition: libmints/molecule.h:70
bool charge_specified() const
Whether the charge was given by the user.
Definition: libmints/molecule.h:234
const std::string name() const
Get molecule name.
Definition: libmints/molecule.h:244
bool has_inversion(Vector3 &origin, double tol=DEFAULT_SYM_TOL) const
Does the molecule have an inversion center at origin.
Definition: libmints/molecule.cc:2115
void print_rotational_constants(void) const
Print the rotational constants.
Definition: libmints/molecule.cc:2047
int multiplicity_
The multiplicity (defined as 2Ms + 1)
Definition: libmints/molecule.h:120
const std::string FullPointGroupList[]
Definition: libmints/molecule.h:57
std::string flabel(int atom) const
Returns label of atom.
Definition: libmints/molecule.cc:3079
std::string symbol(int atom) const
Returns the cleaned up label of the atom (C2 =&gt; C, H4 = H)
Definition: libmints/molecule.cc:318
void rotate(const Matrix &R)
Definition: libmints/molecule.cc:662
std::shared_ptr< Molecule > py_extract_subsets_3(int reals, py::list ghost)
Definition: libmints/molecule.cc:1557
void print_out_of_planes() const
Definition: libmints/molecule.cc:1867
const std::vector< int > & fragment_charges() const
The charge of each fragment.
Definition: libmints/molecule.h:620
std::string full_point_group_with_n() const
Return point group name such as Cnv or Sn.
Definition: libmints/molecule.h:664
bool lock_frame_
Nilpotence boolean (flagged upon first determination of symmetry frame, reset each time a substantiat...
Definition: libmints/molecule.h:177
Definition: libmints/molecule.h:52
int nfragments() const
The number of fragments in the molecule.
Definition: libmints/molecule.h:236
void print_in_angstrom() const
Print the molecule in Angstrom.
Definition: libmints/molecule.cc:1608
int nactive_fragments()
The number of active fragments in the molecule.
Definition: libmints/molecule.cc:1482
std::string save_string_xyz_file() const
Save an XYZ file to a string.
Definition: libmints/molecule.cc:1930
bool valid_atom_map(double tol=0.05) const
Check if current geometry fits current point group.
Definition: libmints/molecule.cc:3156
Molecule & operator=(const Molecule &other)
Definition: libmints/molecule.cc:192
Molecule()
Definition: libmints/molecule.cc:162
std::string fsymbol(int atom) const
Returns the cleaned up label of the atom (C2 =&gt; C, H4 = H)
Definition: libmints/molecule.cc:323
bool has_zmatrix() const
Whether this molecule has at least one zmatrix entry.
Definition: libmints/molecule.h:627
Vector rotational_constants(double tol=FULL_PG_TOL) const
Compute the rotational constants and return them in wavenumbers.
Definition: libmints/molecule.cc:2011
std::string save_string_xyz() const
Save an XYZ string.
Definition: libmints/molecule.cc:1958
bool is_axis(Vector3 &origin, Vector3 &axis, int order, double tol=DEFAULT_SYM_TOL) const
Is an axis?
Definition: libmints/molecule.cc:2142
int full_pg_n_
n of the highest rotational axis Cn
Definition: libmints/molecule.h:152
char ** irrep_labels()
Returns the irrep labels.
Definition: libmints/molecule.cc:2920
Definition: libmints/molecule.h:52
void symmetrize(double tol=0.05, bool suppress_mol_print_in_exc=false)
Definition: libmints/molecule.cc:2749
EntryVector full_atoms_
Atom info vector (includes dummy atoms)
Definition: libmints/molecule.h:102
void reinterpret_fragments()
void operator+=(const Molecule &other)
Plus equals.
Definition: libmints/molecule.cc:271
Definition: libmints/molecule.h:50
void print_bond_angles() const
Definition: libmints/molecule.cc:1801
std::shared_ptr< Molecule > py_extract_subsets_2(py::list reals, int ghost=-1)
Definition: libmints/molecule.cc:1543
void deactivate_all_fragments()
Definition: libmints/molecule.cc:1491
int atom_at_position1(double *, double tol=0.05) const
Definition: libmints/molecule.cc:333
int nunique() const
Definition: libmints/molecule.h:443
int max_nequivalent() const
Definition: libmints/molecule.cc:2245
Definition: libmints/molecule.h:77
Makes using matrices just a little easier.
Definition: libmints/matrix.h:70
void print_full() const
Print full atom list.
Definition: libmints/molecule.cc:1763
void set_geometry(double **geom)
Definition: libmints/molecule.cc:553
void set_ghost_fragment(int fragment)
Definition: libmints/molecule.cc:1523
CoordValue * get_coord_value(const std::string &str)
Definition: libmints/molecule.cc:3129
FullPointGroup full_pg_
Full point group.
Definition: libmints/molecule.h:150
std::string sym_label()
Returns the symmetry label.
Definition: libmints/molecule.cc:2914
double charge(int atom) const
Returns charge of atom.
Definition: libmints/molecule.cc:2989
double fZ(int atom) const
Nuclear charge of atom.
Definition: libmints/molecule.cc:2954
int atom_to_unique(int iatom) const
Definition: libmints/molecule.h:452
void set_units(GeometryUnits units)
Sets the geometry units.
Definition: libmints/molecule.h:647
bool orientation_fixed() const
Get whether or not orientation is fixed.
Definition: libmints/molecule.h:652
Definition: coordentry.h:55
Definition: libmints/molecule.h:50
bool multiplicity_specified() const
Whether the multiplicity was given by the user.
Definition: libmints/molecule.h:232
static std::shared_ptr< Molecule > create_molecule_from_string(const std::string &geom)
Definition: libmints/molecule.cc:799
void set_shell_by_label(const std::string &label, const std::string &name, const std::string &type="BASIS")
Definition: libmints/molecule.cc:3060
int * nequiv_
Number of equivalent atoms per unique atom (length nunique_)
Definition: libmints/molecule.h:157
std::shared_ptr< PointGroup > find_highest_point_group(double tol=DEFAULT_SYM_TOL) const
Find highest molecular point group.
Definition: libmints/molecule.cc:2573
#define DEFAULT_SYM_TOL
Definition: libmints/molecule.h:41
void set_full_point_group(double tol=FULL_PG_TOL)
Determine and set FULL point group.
Definition: libmints/molecule.cc:3205
virtual ~Molecule()
Definition: libmints/molecule.cc:184
double nuclear_repulsion_energy() const
Computes nuclear repulsion energy.
Definition: libmints/molecule.cc:414
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:283
void set_basis_by_label(const std::string &label, const std::string &name, const std::string &type="BASIS")
Definition: libmints/molecule.cc:3052
int atom_to_unique_offset(int iatom) const
Definition: libmints/molecule.cc:2233
Definition: libmints/molecule.h:50
void set_com_fixed(bool fix=true)
Fix the center of mass at its current frame.
Definition: libmints/molecule.h:656
Definition: libmints/molecule.h:82
Matrix distance_matrix() const
Computes and returns a matrix depicting distances between atoms.
Definition: libmints/molecule.cc:389
double z(int atom) const
z position of atom
Definition: libmints/molecule.cc:2969
std::string full_point_group() const
Return point group name such as C3v or S8.
Definition: libmints/molecule.cc:3507
FullPointGroup
Definition: libmints/molecule.h:51
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:2645
void set_orientation_fixed(bool fix=true)
Fix the orientation at its current frame.
Definition: libmints/molecule.h:654
bool zmat_
Whether this molecule has at least one zmatrix entry.
Definition: libmints/molecule.h:179
RotorType rotor_type(double tol=FULL_PG_TOL) const
Return the rotor type.
Definition: libmints/molecule.cc:2073
std::vector< int > fragment_charges_
The charge of each fragment.
Definition: libmints/molecule.h:104
double x(int atom) const
x position of atom
Definition: libmints/molecule.cc:2959
std::pair< int, int > fragment_atom_pair(int f)
Returns the list of atoms belonging to a fragment.
Definition: libmints/molecule.h:241
bool multiplicity_specified_
Whether the multiplicity was specified by the user.
Definition: libmints/molecule.h:116
std::string name_
Molecule (or fragment) name.
Definition: libmints/molecule.h:98
void set_molecular_charge(int charge)
Sets the molecular charge.
Definition: libmints/molecule.h:639
EntryVector atoms_
Atom info vector (no knowledge of dummy atoms)
Definition: libmints/molecule.h:100
Definition: libmints/molecule.h:51
int unique(int iuniq) const
Returns the overall number of the iuniq&#39;th unique atom.
Definition: libmints/molecule.h:445
void set_basis_all_atoms(const std::string &name, const std::string &type="BASIS")
Definition: libmints/molecule.cc:3023
void clear()
Zero it out.
Definition: libmints/molecule.cc:276
void set_basis_by_number(int number, const std::string &name, const std::string &type="BASIS")
Definition: libmints/molecule.cc:3034
Molecule information class.
Definition: libmints/molecule.h:64
void set_active_fragments(py::list reals)
Definition: libmints/molecule.cc:1499
double input_units_to_au_
The conversion factor to take input units to Bohr.
Definition: libmints/molecule.h:124
double fy(int atom) const
y position of atom
Definition: libmints/molecule.cc:2979
Definition: libmints/molecule.h:52
double mass(int atom) const
Returns mass atom atom.
Definition: libmints/molecule.cc:302
Definition: libmints/molecule.h:90
Definition: libmints/molecule.h:83
bool has_symmetry_element(Vector3 &op, double tol=DEFAULT_SYM_TOL) const
Definition: libmints/molecule.cc:2733
Molecule operator+(const Molecule &other)
Addition.
void set_multiplicity(int mult)
Sets the multiplicity (defined as 2Ms + 1)
Definition: libmints/molecule.h:643
Vector3 xyz(int atom) const
Returns a Vector3 with x, y, z position of atom.
Definition: libmints/molecule.cc:2934
GeometryUnits units() const
Gets the geometry units.
Definition: libmints/molecule.h:649
void set_nuclear_charge(int atom, double newZ)
Set the nuclear charge of an atom (primarily used in ECP calculations).
Definition: libmints/molecule.cc:2999
void print_cluster() const
Print the molecule, adding spacers.
Definition: libmints/molecule.cc:1727
Definition: libmints/molecule.h:52
Definition: libmints/molecule.h:84
int nallatom() const
Number of all atoms (includes dummies)
Definition: libmints/molecule.h:252
void set_point_group(std::shared_ptr< PointGroup > pg)
Definition: libmints/molecule.cc:2726
std::vector< std::string > all_variables_
A list of all variables known, whether they have been set or not.
Definition: libmints/molecule.h:126
double fcharge(int atom) const
Returns charge of atom.
Definition: libmints/molecule.cc:2994
Definition: vector.h:50
void save_xyz_file(const std::string &filename, bool save_ghosts=true) const
Save an XYZ file.
Definition: libmints/molecule.cc:1907
std::string create_psi4_string_from_molecule() const
Definition: libmints/molecule.cc:1312
double fz(int atom) const
z position of atom
Definition: libmints/molecule.cc:2984
void set_has_zmatrix(bool tf)
Sets whether this molecule contains at least one zmatrix entry.
Definition: libmints/molecule.h:625
double get_variable(const std::string &str)
Definition: libmints/molecule.cc:3115
double fx(int atom) const
x position of atom
Definition: libmints/molecule.cc:2974
int ftrue_atomic_number(int atom) const
Definition: libmints/molecule.cc:3016
GeometryUnits
Definition: libmints/molecule.h:77
void translate(const Vector3 &r)
Translates molecule by r.
Definition: libmints/molecule.cc:512
int * atom_to_unique_
Atom to unique atom mapping array (length natom)
Definition: libmints/molecule.h:161
int natom() const
Number of atoms.
Definition: libmints/molecule.cc:3531
void set_full_geometry(double **geom)
Definition: libmints/molecule.cc:640
std::shared_ptr< Molecule > py_extract_subsets_4(int reals, int ghost=-1)
Definition: libmints/molecule.cc:1569
void symmetrize_to_abelian_group(double tol)
Definition: libmints/molecule.cc:1382
Definition: libmints/molecule.h:72
Vector3 center_of_mass() const
Computes center of mass of molecule (does not translate molecule)
Definition: libmints/molecule.cc:370
Definition: libmints/molecule.h:51
Matrix nuclear_repulsion_energy_deriv1() const
Computes nuclear repulsion energy derivatives.
Definition: libmints/molecule.cc:431
bool move_to_com_
Move to center of mass or not?
Definition: libmints/molecule.h:111