The present study discusses the development of an algorithm to generate input files for quantum mechanical (QM) calculations from molecular dynamics (MD) trajectories of protein-carbohydrate complex simulations and QM optimization of binding-site residues of influenza hemagglutinin H1 along with its cell surface receptor sialyldisaccharides Neu5Acα(2→3)Gal (N23G) and Neu5Acα(2→6)Gal (N26G). Five frames from the local minima of MD trajectories were chosen for QM calculations. The geometry optimization was carried out by Gaussian09 software. The optimized geometries were analyzed, and the resultant ab initio molecular structures can be used for inhibitor design and therapeutics of influenza A virus. Copyright © 2015 Taylor & Francis Group, LLC.