In this paper, we give a Lichnerowicz type formula for the J-twist $$D_{J}$$
D
J
of the Dirac operator. And we prove a Kastler–Kalau–Walze type theorem for the J-twist $$D_{J}$$
D
J
of the Dirac operator on three-dimensional and four-dimensional almost product Riemannian spin manifold with boundary.