  The partial transpose (PT) is an important function for entanglement testing
and quantification and also for the study of geometrical aspects of the quantum
state space. In this article, considering general bipartite and multipartite
discrete systems, explicit formulas ready for the numerical implementation of
the PT and of related entanglement functions are presented and the Fortran code
produced for that purpose is described. What is more, we obtain an analytical
expression for the Hilbert-Schmidt entanglement of two-qudit systems and for
the associated closest separable state. In contrast to previous works on this
matter, we only use the properties of the PT, not applying Lagrange
multipliers.
