def testGetReducedMass2(self):
        """
        tests that get_reduced_mass returns proper value when isotopes are labeled
        """
        labels = ['*1','*3']
        reactants = [Molecule().fromAdjacencyList("""1 *1 C u0 p0 c0 i13 {2,S} {3,S} {4,S} {5,S}
2 *2 H u0 p0 c0 {1,S}
3    H u0 p0 c0 {1,S}
4    H u0 p0 c0 {1,S}
5    H u0 p0 c0 {1,S}
"""),Molecule().fromAdjacencyList("""multiplicity 2
1 *3 H u1 p0 c0
""")]
        reduced_mass = get_reduced_mass(reactants,labels,True)
        self.assertAlmostEqual(reduced_mass,1/(1/1.008+1/(1.008+13.01))/1000,places=6)
Esempio n. 2
0
    def test_get_reduced_mass2(self):
        """
        tests that get_reduced_mass returns proper value when isotopes are labeled
        """
        labels = ['*1', '*3']
        reactants = [
            Molecule().from_adjacency_list("""
1 *1 C u0 p0 c0 i13 {2,S} {3,S} {4,S} {5,S}
2 *2 H u0 p0 c0 {1,S}
3    H u0 p0 c0 {1,S}
4    H u0 p0 c0 {1,S}
5    H u0 p0 c0 {1,S}
"""),
            Molecule().from_adjacency_list("""
multiplicity 2
1 *3 H u1 p0 c0
""")]
        reduced_mass = get_reduced_mass(reactants, labels, True)
        self.assertAlmostEqual(reduced_mass, 1 / (1 / 1.008 + 1 / (1.008 + 13.01)) / 1000, places=6)
Esempio n. 3
0
    def testGetReducedMass(self):
        """
        tests that get_reduced_mass returns the proper value for H_abstraction
        """
        labels = ['*1', '*3']
        reactants = [
            Molecule().fromAdjacencyList(
                """1 *1 C u0 p0 c0 {2,S} {3,S} {4,S} {5,S}
2 *2 H u0 p0 c0 {1,S}
3    H u0 p0 c0 {1,S}
4    H u0 p0 c0 {1,S}
5    H u0 p0 c0 {1,S}
"""),
            Molecule().fromAdjacencyList("""multiplicity 2
1 *3 H u1 p0 c0
""")
        ]
        reduced_mass = get_reduced_mass(reactants, labels, True)
        self.assertAlmostEqual(reduced_mass,
                               1 / (1 / 1.008 + 1 / (1.008 + 12.01)) / 1000,
                               places=6)