7#include "Accelerator/hybrid.h"
8#include "DataTypes/common_types.h"
9#include "DataTypes/mixed_types.h"
10#include "Topology/atomgraph.h"
16using card::HybridTargetLevel;
17using topology::AtomGraph;
22constexpr int minimum_formal_charge = -8;
23constexpr int maximum_formal_charge = 7;
24constexpr int formal_charge_range = maximum_formal_charge - minimum_formal_charge + 1;
25constexpr int formal_charge_bits = 4;
29constexpr int default_indigo_energy_gap = 3187;
33constexpr int maximum_negative_carbons = 1;
36constexpr int maximum_bond_order = 3;
37constexpr int bond_order_range = maximum_bond_order + 1;
40constexpr int maximum_indigo_atomic_number = 35;
41constexpr int indigo_atomic_number_range = maximum_indigo_atomic_number + 1;
53int IndigoFormalChargeKey(
int atomic_number,
int formal_charge);
66int IndigoBondOrderKey(
int atomic_number_i,
int atomic_number_j,
int bond_order);
69std::vector<int> indigoFormalChargeScores();
72std::vector<int> indigoBondOrderScores();
81 int valence_electrons_in,
const std::vector<int> &relevant_bonds_in,
82 const std::vector<int> &partner_atoms_in,
const std::vector<int> &atom_scores,
83 const std::vector<int> &bond_scores);
94 uint
getState(
int state_index)
const;
107 int getScore(
int state_index)
const;
163 int valence_electrons;
168 std::vector<int> relevant_bonds;
170 std::vector<int> partner_atoms;
172 std::vector<uint> states;
177 std::vector<int> scores;
189 uint computeState(
const int fc_value,
const std::vector<uint> &bond_orders);
199 int computeScore(
const uint state,
const std::vector<int> &atom_scores,
200 const std::vector<int> &bond_scores);
217 const std::vector<IndigoAtomCenter> &all_centers,
218 int score_delta = default_indigo_energy_gap);
232 std::vector<int2>
getState(
int state_index)
const;
249 int getScore(
int state_index)
const;
279 const std::vector<IndigoAtomCenter> &atom_centers)
const;
292 int score_delta = default_indigo_energy_gap);
301 std::vector<int> centers_list;
302 std::vector<int*> states;
308 std::vector<int> states_data;
310 std::vector<int> net_charges;
312 std::vector<int> scores;
388 double ground_state_energy;
389 std::vector<int> real_atom_map;
392 std::vector<int> real_bond_map;
394 std::vector<int> bond_i_atoms;
396 std::vector<int> bond_j_atoms;
398 std::vector<int> atom_connect_bounds;
400 std::vector<int> atom_relevant_bonds;
406 std::vector<int> atom_bond_partners;
409 std::vector<int> atom_scores;
410 std::vector<int> bond_scores;
411 std::vector<int> valence_electrons;
418 std::vector<IndigoAtomCenter> atom_centers;
429 std::vector<IndigoFragment> mutable_fragments;
433 std::vector<double> ground_state_formal_charges;
436 std::vector<double> ground_state_bond_orders;
439 std::vector<double> ground_state_free_electrons;
442 std::vector<double> zerok_formal_charges;
445 std::vector<double> zerok_bond_orders;
448 std::vector<double> zerok_free_electrons;
464 std::vector<double> *acc_formal_charges,
465 std::vector<double> *acc_bond_orders,
466 std::vector<double> *acc_free_electrons,
int accumulation = 0,
467 double probability = 1.0);
Enumerate the possible combinations of formal charge state and the orders of bonds relevant to a part...
Definition indigo.h:76
bool queryBondToPartner(int partner_atom_number, int partner_bo) const
Determine whether an atom center makes a bond of a certain order to a specific partner.
Definition indigo.cpp:748
int getIndigoTableIndex() const
Let it be known which atom this center pertains to.
Definition indigo.cpp:652
int getRelevantBond(int index) const
Get the index of the relevant bond connecting this atom to the partner of the same index....
Definition indigo.cpp:721
int getPartner(int index) const
Get one of the partners for a specific atom center. Return the atom center index of the partner in th...
Definition indigo.cpp:726
int getAtomicNumber() const
Get the atomic number of the atom.
Definition indigo.cpp:672
int cullByPartners(const std::vector< IndigoAtomCenter > &acen)
Cull states from a particular atom center if its partners cannot reciprocate with the correct bond or...
Definition indigo.cpp:763
void sortStates()
Sort the states to put the lowest energy (lowest scoring) state first.
Definition indigo.cpp:682
int getBondOrderOfState(int bond_index, int state_index) const
Get the order of a bond made by this atom center to a specified partner when the atom center lies in ...
Definition indigo.cpp:743
int getScore(int state_index) const
Return the score associated with a particular state of this atom center.
Definition indigo.cpp:677
uint getState(int state_index) const
Return the bitmask describing a particular state of this atom center.
Definition indigo.cpp:662
int getStateCount() const
Return the number of states this atomc center can take on.
Definition indigo.cpp:657
int findPartnerIndex(int partner_atom_number) const
Find a partner atom within the local list of this atom center. Return the index of the partner atom i...
Definition indigo.cpp:731
IndigoAtomCenter(int table_index_in, int z_number_in, int bond_count_in, int valence_electrons_in, const std::vector< int > &relevant_bonds_in, const std::vector< int > &partner_atoms_in, const std::vector< int > &atom_scores, const std::vector< int > &bond_scores)
The constructor takes the parent IndigoTable's lists of atoms and bonds.
Definition indigo.cpp:426
int getCharge(int state_index) const
Get the charge of an atom center in a particular state.
Definition indigo.cpp:667
int getPartnerCount() const
Get the number of partners in this atom center.
Definition indigo.cpp:716
int getGlobalCenter(int center_index) const
Get the index of a center in the fragment within the molecule system as a whole.
Definition indigo.cpp:1095
std::vector< int2 > getState(int state_index) const
Return the vector of {atom center number, atom center state} tuples describing a particular state of ...
Definition indigo.cpp:1086
std::vector< int3 > getChargesAndBestEnergies() const
Get the range of charges and the minimum energy states that can produce each charge offered by this f...
Definition indigo.cpp:1132
int getCenterCount() const
Get the number of centers in this fragment.
Definition indigo.cpp:1076
std::vector< int2 > getStatesBearingCharge(int charge_value) const
Get all states in a fragment bearing a particular charge. The energy of each state satisfying the net...
Definition indigo.cpp:1166
int getStateCount() const
Get the number of states in this fragment.
Definition indigo.cpp:1081
int cullStatesBearingCharge(int charge_value)
Cull states of a fragment that bear a specific charge.
Definition indigo.cpp:1213
std::vector< int > getChargeStates() const
Create a vector of the unique charge states in a fragment.
Definition indigo.cpp:1115
int getScore(int state_index) const
Return the score associated with a particular state of this atom center.
Definition indigo.cpp:1110
IndigoFragment(const std::vector< int > ¢ers_list_in, const std::vector< IndigoAtomCenter > &all_centers, int score_delta=default_indigo_energy_gap)
Constructor takes a list of atoms, then determines the bonds between them and whatever connections to...
Definition indigo.cpp:799
int cullHigherEnergyStatesByCharge(int charge_value, int score_delta=default_indigo_energy_gap)
Cull non-optimal states of a fragment that bear a specific charge.
Definition indigo.cpp:1233
bool testEquivalence(const IndigoFragment &other, const std::vector< int > &real_atom_map, const AtomGraph *ag_pointer, const std::vector< IndigoAtomCenter > &atom_centers) const
Assess whether two fragments are equivalent, just with different atom indices. Return the result as a...
Definition indigo.cpp:1177
int getCharge(int state_index) const
Get the charge of this fragment in a particular state. There total charges were compute when the obje...
Definition indigo.cpp:1105
std::vector< int2 > getZeroKelvinBondOrders() const
Return the system's ground state bond orders, taking only a single representation of each bond and fo...
Definition indigo.cpp:2050
std::vector< int2 > getZeroKelvinFormalCharges() const
Return the system's ground state formal charges, taking only a single representation of each bond and...
Definition indigo.cpp:2035
std::vector< CombineIDp > getGroundStateFreeElectrons() const
Return the number of free electrons on each atom in the system's ground state.
Definition indigo.cpp:2026
IndigoTable(const AtomGraph *ag_in, int molecule_index=0, double temperature_in=300.0)
The constructor takes a topology and options for the min and max formal charge (these are merely to a...
Definition indigo.cpp:1261
std::vector< int2 > getZeroKelvinFreeElectrons() const
Return the system's ground state electron content, taking only a single representation of each bond a...
Definition indigo.cpp:2069
std::vector< CombineIDp > getGroundStateBondOrders() const
Return the system's ground state bond orders in a form amenable to the original topology....
Definition indigo.cpp:2017
int getBondCount() const
Get the number of bonds.
Definition indigo.cpp:1998
int getAtomCount() const
Get the number of atoms.
Definition indigo.cpp:1993
double getGroundStateEnergy() const
Return the system's ground state energy.
Definition indigo.cpp:2084
std::vector< CombineIDp > getGroundStateFormalCharges() const
Return the system's ground state formal charges in a form amenable to the original topology....
Definition indigo.cpp:2008
int getNetCharge() const
Get the net charge on the system.
Definition indigo.cpp:2003
A struct to hold information relating to an Amber topology. This struct's member functions are limite...
Definition atomgraph.h:50