The Samsung Galaxy S4 comes in a variety of model numbers here in the US. There is a version for AT&T (model SGH-I337), one for T-Mobile (model SGH-M919), and more for other carriers that sell the S4. Generally, these phones are locked to their original service providers, though one can purchase an unlocked version of the S4 (GT-I9500) that is sold on Amazon, eBay, and other online merchants.
AT&T and T-Mobile will both provide you an unlock code to unfetter the phone from their networks IF one pays full retail price for it (currently $640 or above). If you want to be able to unlock and use the phone on both AT&T's and T-Mobile's networks, you are better-off purchasing the T-Mobile model outright and getting it unlocked. It will (according to specs published on Samsung's website) work on BOTH networks, adding some amount of flexibility to switch carriers at will.
Another advantage of paying full-price for the phone is that you are not tied into a contract …
Yesterday, Absolute Software announced its phone recovery service, LoJack, for the new Samsung Galaxy S4 line. This service is a first for smartphones, and previously offered for PCs, laptops, vehicles, and even humans. A question that people may have is: "so what? I have software that can already do that!"
All software that is currently available to track smartphones has to be installed as an app. There is a are problem with that: an app can be uninstalled! Even if you have some rudimentary security mechanisms (such as a PIN) to prevent the security app from being uninstalled, the phone can be reset to factory condition, thereby erasing everything on it. Phone service providers like AT&T and Verizon are working on creating a database to track stolen phones but you have to understand that they are in the business of selling new phones and providing service, not in law-enforcement! The database will, therefore, not necessarily help recover phones.