def to_zmatrix_old(x2m): """ Generate a Z-Natrix from an x2z molecule object (old). :param x2m: molecule object :type x2m: x2z molecule object :rtype: automol Z-Matrix data structure """ zma_str = pyx2z.zmatrix_string(x2m) syms, key_mat, name_mat, val_mat = ar.zmat.read( zma_str, mat_entry_sep_ptt=',', mat_entry_start_ptt=',', setv_sep_ptt=app.padded(app.one_of_these(['', app.NEWLINE]))) zma = automol.create.zmat.from_data(syms, key_mat, name_mat, val_mat, one_indexed=True, angstrom=False, degree=True) return zma
def test__zmatrix_string(): """ test pyx2z.zmatrix_sring() """ asymbs = ['C', 'O', 'C', 'H', 'H', 'H', 'C', 'H', 'H', 'H'] coords = [(-2.2704178657, 2.9586871732, -0.0000000000), (-2.0230332171, 1.7537576097, 0.0000000000), (-1.3903791691, 3.9451234997, 0.7188849720), (-0.5605839137, 3.4182459749, 1.1980823377), (-1.9710320856, 4.4623547554, 1.4866301464), (-0.9857357677, 4.6646475866, 0.0028769813), (-3.4679340657, 3.5185797384, -0.7188849720), (-4.0230068872, 2.7073743052, -1.1980823377), (-3.1380484986, 4.2227540733, -1.4866301464), (-4.1233452839, 4.0204635187, -0.0028769813)] m = _molec_geom_obj(asymbs, coords) s = pyx2z.MolecStruct(m, []) string = pyx2z.zmatrix_string(s) print(string)
def to_zmatrix(x2m): """ z-matrix from an x2z molecule object """ zma_str = pyx2z.zmatrix_string(x2m) syms, key_mat, name_mat, val_dct = ar.zmatrix.read( zma_str, mat_entry_sep_ptt=',', mat_entry_start_ptt=',', setv_sep_ptt=app.padded(app.one_of_these(['', app.NEWLINE]))) zma = _zmatrix_from_data(syms, key_mat, name_mat, val_dct, one_indexed=True, angstrom=False, degree=True) return zma