Never install laminate over residential carpet or carpet undurlay.
Since carpet is soft, laminate flooring would not have the support it needs to keep the locking system sturdy.