Ejemplo n.º 1
0
def test_atoms():

    assert atoms.get_maximal_valance(atom_label='C') == 4
    assert atoms.get_maximal_valance(atom_label='Aa') == 6
    assert atoms.get_atomic_weight(atom_label='C') == 12.01
    assert atoms.get_atomic_weight(atom_label='Aa') == 70
    assert 0.9 < atoms.get_vdw_radius(atom_label='H') < 1.2
    assert 2 < atoms.get_vdw_radius(atom_label='Aa') < 3

    assert atoms.is_pi_atom(atom_label='C', valency=3) is True
    assert atoms.is_pi_atom(atom_label='C', valency=4) is False
    assert atoms.is_pi_atom(atom_label='Aa', valency=9) is False
Ejemplo n.º 2
0
def calc_atom_entropy(atom_label, temp):
    """
    Calculate the entropy of a single atom, not available in ORCA as only the
    translational contribution: S_trans = R (ln(q_trans) + 5R/2)

    Arguments:
        atom_label (str):
        temp (float): Temperature in K

    Returns:
        (float):
    """

    k_b = 1.38064852E-23          # J K-1
    h = 6.62607004E-34            # J s
    n_a = 6.022140857E23          # molecules mol-1
    atm_to_pa = 101325            # Pa
    amu_to_kg = 1.660539040E-27   # Kg

    mass = amu_to_kg * get_atomic_weight(atom_label=atom_label)
    v_eff = k_b * temp / atm_to_pa
    q_trans = ((2.0 * np.pi * mass * k_b * temp / h**2)**1.5 * v_eff)

    s = k_b * n_a * (np.log(q_trans) + 2.5)
    # Convert from J K-1 mol-1 to K-1 Ha
    return s / (Constants.ha2kJmol * 1000)
Ejemplo n.º 3
0
def get_atom_ids_sorted_type(species):
    """
    Get a list of atom ids sorted by increasing atomic weight, useful for when
     a molecular graph depends on the order
    of atoms in what will be considered bonded

    Arguments:
        species (autode.species.Species):

    Returns:
        (list(int)):
    """
    return sorted(
        list(range(species.n_atoms)),
        key=lambda i: get_atomic_weight(atom_label=species.atoms[i].label))
Ejemplo n.º 4
0
    def density(self):
        """Calculate the density of the system in g cm-3"""

        total_mw = sum([
            get_atomic_weight(atom.label) for m in self.molecules
            for atom in m.atoms
        ])  # g mol-1

        # ρ = m / V  ->  ρ = (mw / Na) / (V) * 1E-3
        n_a = 6.02214086E23  # thing mol^-1
        a_m, b_m, c_m = self.box.size * 1E-10  # m
        per_m3_to_per_cm3 = 1E-6

        rho = (total_mw / n_a) / (a_m * b_m * c_m)  # g m^-3
        rho_g_per_cm3 = per_m3_to_per_cm3 * rho  # g cm^-3

        return rho_g_per_cm3
Ejemplo n.º 5
0
 def weight(idx):
     """Given an atom index return the molecular weight in amu"""
     return get_atomic_weight(atom_label=species.atoms[idx].label)