We consider the effect of a
magnetic field for the asymptotic behavior of the trace of the heat kernel for the
Schrödinger operator. We discuss the case where the operator has compact
resolvents in spite of the fact that the electric potential is degenerate on some
submanifold. According to the degree of the degenaracy, we obtain the classical and
non-classical asymptotics.