예제 #1
0
def test__add_atom():
    """ test zmat.add_atom

    output below should look like this:
        C
        O  1    R2
        C  2    R3  1    A3
        H  3    R4  2    A4  1    D4
        H  3    R5  2    A5  1    D5
        H  3    R6  2    A6  1    D6

        R2   =   1.500000
        R3   =   1.500000
        R4   =   1.500000
        R5   =   1.500000
        R6   =   1.500000
        A3   = 120.000000
        A4   = 120.000000
        A5   = 120.000000
        A6   = 120.000000
        D4   =   0.000000
        D5   = 109.470000
        D6   =-109.470000
    """
    zma = ()
    zma = zmat.add_atom(zma, 'C', (), ())
    zma = zmat.add_atom(zma, 'O', (0, ), (1.5, ))
    zma = zmat.add_atom(zma, 'C', (1, 0), (1.5, 120.))
    zma = zmat.add_atom(zma, 'H', (2, 1, 0), (1.5, 120., 0.))
    zma = zmat.add_atom(zma, 'H', (2, 1, 0), (1.5, 120., +109.47))
    zma = zmat.add_atom(zma, 'H', (2, 1, 0), (1.5, 120., -109.47))
    print(zmat.string(zma))
예제 #2
0
def test__string():
    """ test zmat.string
    """
    zma = zmat.from_string(zmat.string(CH4O2_ZMA))
    assert zmat.almost_equal(zma, CH4O2_ZMA)