  We present the symplectic algorithm in the Lagrangian formalism for the
Hamiltonian systems by virtue of the noncommutative differential calculus with
respect to the discrete time and the Euler--Lagrange cohomological concepts. We
also show that the trapezoidal integrator is symplectic in certain sense.
