Entanglement between a qubit and the environment in the spin-boson model