  We provide a detailed formulation of the recently proposed variational
approach [Y. Ashida et al., Phys. Rev. Lett. 121, 026805 (2018)] to study
ground-state properties and out-of-equilibrium dynamics for generic quantum
spin-impurity systems. Motivated by the original ideas by Tomonaga, Lee, Low,
and Pines, we construct a canonical transformation that completely decouples
the impurity from the bath degrees of freedom. By combining this transformation
with a Gaussian ansatz for the fermionic bath, we obtain a family of
variational many-body states that can efficiently encode the strong
entanglement between the impurity and fermions of the bath. We give a detailed
derivation of equations of motions in the imaginary- and real-time evolutions
on the variational manifold. We benchmark our approach by applying it to
investigate ground-state and dynamical properties of the anisotropic Kondo
model and compare results with those obtained using matrix-product state (MPS)
ansatz. We show that our approach can achieve an accuracy comparable to
MPS-based methods with several orders of magnitude fewer variational parameters
than the corresponding MPS ansatz. Comparisons to the Yosida ansatz and the
exact solution from the Bethe ansatz are also discussed. We use our approach to
investigate the two-lead Kondo model and analyze its long-time spatiotemporal
behavior and the conductance behavior at finite bias and magnetic fields. The
obtained results are consistent with the previous findings in the Anderson
model and the exact solutions at the Toulouse point.
